feat(vue): support experimental.componentDetection - #6731
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe changes document Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
experimental.componentDetection
|
@codspeedbot retry |
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
🔗 Linked issue
Relates to #6296
❓ Type of change
📚 Description
Ports
experimental.componentDetectionto the Vue (unplugin) integration. It already exists for Nuxt, but the Vue build always emitted@source "./ui", so Tailwind scanned all ~163 generated theme files and every app shipped CSS for every component even if it used one.With detection enabled, the plugin scans the Vite root for used components and narrows the emitted
@sourcelines to just those components and their dependencies. In an isolated single-UButtonapp this cuts the theme CSS from 179 KB to 45 KB (75%). Stays opt-in in v4.The shared
generateSourceschange keeps the Nuxt output byte-identical (layer and inline sources stay Nuxt-only, the detection branch is equivalent). Full suite passes with zero snapshot changes, and a newtest/utils/component-detection.spec.tscovers the narrowing, the disabled default, and the empty-detection fallback.Stacked on #6730.
Important
Two things for review: the doc badge is a placeholder
4.10+, please set it to the real target release. And newly used components are only picked up on the next dev-server start (documented as a restart note); live HMR re-detection is left as a follow-up.📝 Checklist