Skip to content

perf(build): split the vendor chunk by the pages that use it - #522

Merged
harlan-zw merged 1 commit into
mainfrom
perf/vendor-split
Oct 7, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
perf/vendor-split

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

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

📚 Description

Every page preloaded one vendor-shared chunk of 692 kB raw. It held the reka-ui menus, selects, hover cards and dialogs that only some pages open, beside the Vue runtime that every page needs.

The group now has two parts. vendor-shared keeps what the app entry imports, through Rolldown's $initial tag. vendor-lazy takes the rest and splits it by the set of pages that import each module (entriesAware), folding sets under 20 kB into a neighbour. A page now loads only the vendor code its own components use.

JavaScript each launch page preloads, from local pnpm build output against main at 6bd14f7:

Page Files Raw Gzip
/ 31 → 38 1,046 → 951 kB 330 → 313 kB
/skills/demos 23 → 27 997 → 816 kB 312 → 273 kB
/skills/trending 25 → 29 1,012 → 830 kB 318 → 279 kB
/gh/anthropics/skills/frontend-design 22 → 30 1,081 → 1,015 kB 334 → 325 kB
/cli 25 → 29 1,026 → 844 kB 326 → 286 kB
/developers 19 → 24 1,106 → 940 kB 344 → 308 kB

The trade is 4 to 8 more files per page, which crawl efficiency counts as a crawl cost. A 60 kB fold threshold gave no smaller page and more files, so 20 kB stays.

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

vendor-shared held 692 kB raw on every page, including reka-ui menus, selects and hover cards that only some pages open. What the app entry imports stays in vendor-shared; the rest splits by the set of pages importing it.
@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 before and after this split on the six launch pages, at 412 and 1350 pixels, with scripts off and on: 0 rows differ.
  • On the local build: the hero promo popover opens, the search opens, client navigation from / to /skills/trending and on to /skills/demos works, a demo pick switches the stage, and a /developers mode link navigates. No page errors.

@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 8308ba4 into main Oct 7, 2026
6 checks passed
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