Skip to content

Conversation

@antfu
Copy link
Collaborator

@antfu antfu commented Feb 11, 2026

#1239

This PR made the following two changes to optimize the css chunking:

  • Make the component and styles of Vue Data UI async on-demand
  • Separate the icons layer from the main UnoCSS entry and then it async
    • This would introduce a side-effect that the icons css become unblocking and might have flash-of-no-icons on first load. We could discuss if this would be worth it.

Deploy Preview: https://npmxdev-git-fix-css-optimization-npmx.vercel.app/

Before:
CleanShot 2026-02-11 at 18 18 07@2x

After:
CleanShot 2026-02-11 at 18 17 01@2x

@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 11, 2026 8:55pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 11, 2026 8:55pm
npmx-lunaria Ignored Ignored Feb 11, 2026 8:55pm

Request Review

@antfu antfu changed the title fix: try optimize css bundle perf: optimize css chunks Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Adds UnoCSS imports and an async icon CSS import to the app entry; converts eager vue-data-ui chart components to lazy-loaded components via defineAsyncComponent and adds side-effect style imports; introduces a new UnoCSS source transformer (transformerIconInlineBlock) that appends inline-block sizing tokens to icon classes; updates uno.config.ts to adjust presetIcons and include the transformer and content.pipeline.exclude; disables unocss autoImport in nuxt.config.ts and enables it for the Nuxt test environment in vitest.config.ts; adds uno/uno.css to knip ignoreDependencies. No exported public API signatures were changed.

Possibly related PRs

Suggested labels

front

Suggested reviewers

  • alexdln
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, documenting two optimization changes to CSS chunking with specific technical details and deployment preview.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/css-optimization

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe
Copy link
Member

this is amazing! I do think we need to move inline-block into the individual icons as otherwise there's now tiny layout shifts for every icon.

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