Skip to content

perf(build): inline component styles and slim the vendor chunk - #500

Merged
harlan-zw merged 2 commits into
mainfrom
perf/inline-styles
Oct 7, 2026
Merged

harlan-zw merged 2 commits into
mainfrom
perf/inline-styles

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #467

❓ Type of change

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

📚 Description

Launch pages linked up to nine render-blocking stylesheets, and every page preloaded zod and the content components it never renders.

  • Inline component styles are back. fix: migrate Nuxt 4.6 streaming and Worker bindings #467 set inlineStyles: false because the Nuxt 4.6 server build left an unresolved chunk placeholder (!~{002}~) in its inline-style chunks. The vendor-shared group caused it: it split the server build too. The group now applies to the client build only, so Nuxt's default inlines component CSS again.
  • comark-content stays out of vendor-shared. A group takes a module's static imports with it. ContentRenderer imports every content component, so the Skill card, the package setup form and zod rode in the chunk every page preloads. The rule also matches Nuxt's comark-content%2Fcomponents.mjs template.
  • /cli no longer loads zod. It imports developer-setup.ts for one snippet. The /developers query parsers there now live in developer-setup-query.ts.

Measured on local pnpm build output served by wrangler dev, against origin/main at 00cb19d. Lighthouse 13.5, mobile, cold cache, median of 3 runs.

Page Stylesheet links Preloaded JS, gzip FCP LCP Score
/ 8 → 5 356 → 330 kB 5.1 → 4.8 s 7.5 → 7.5 s 52 → 56
/skills/demos 7 → 4 339 → 312 kB 4.3 → 2.2 s 6.7 → 2.6 s 63 → 93
/skills/trending 9 → 3 344 → 318 kB 4.5 → 3.2 s 6.5 → 3.5 s 63 → 80
/gh/anthropics/skills/frontend-design 3 → 2 364 → 334 kB 4.4 → 4.3 s 7.3 → 7.4 s 54 → 59
/cli 5 → 1 358 → 326 kB 3.5 → 3.1 s 3.8 → 3.4 s 79 → 84
/developers 2 → 1 352 → 344 kB 3.1 → 3.0 s 3.5 → 3.3 s 84 → 87

The trade: each page now preloads 6 to 9 more small files, because the Skill card and its parts get their own chunks instead of riding in vendor-shared. Crawl efficiency counts files as a crawl cost, so this gives some of that back for 26 to 32 kB less gzip on five of the six pages.

The homepage and Skill page LCP did not move. The homepage LCP is the hero heading, and the Skill page LCP is the lazy full-page demo screenshot. Both need separate work.

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

The vendor-shared group also split the server build, which left an unresolved chunk placeholder in Nuxt 4.6's inline-style chunks. Inline styles were switched off to get past it, so pages linked up to nine render-blocking stylesheets. The group now applies to the client build only. It also captured comark-content's ContentRenderer, which pulled every content component and zod into the chunk every page preloads.
/cli imports developer-setup for one snippet, and the /developers query parsers there brought zod into every /cli load.
@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 6, 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 origin/main and this branch on all six launch pages, at 412 and 1350 pixels, with scripts off and on. 0 of 8,573 element rows differ, so inlining changed no layout before or after hydration.
  • With inlineStyles on and the group still applied to both builds, pnpm build fails: Cannot resolve "./entry-styles-8.mjs-!~{002}~.js". With the group client only, it builds.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-07 01:10 UTC.

GitHub merged this pull request.

  • Logged (25/100): The zod enums and the display objects duplicate the same key sets in two files, so future key additions can silently drop valid query values. View code
    • Ask an agent to verify and fix this finding

6e6d9d68-bc83-43c0-9a1e-4231cf205093

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit 80d9b79 into main Oct 7, 2026
7 checks passed
@harlan-zw
harlan-zw deleted the perf/inline-styles branch October 7, 2026 01:01
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 7, 2026
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