perf(types): decouple useComponentProps from the component-types barrel#6648
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThree theme-related types ( Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/composables/useComponentProps.spec.ts (1)
3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winImport
ThemeDefaultsthrough the public composables barrel.This spec now bypasses
src/runtime/composables/index.ts, so a broken re-export there would go unnoticed. Importing from the barrel keeps the test aligned with the public API this PR adds.Suggested change
-import type { ThemeDefaults } from '../../src/runtime/types/theme' +import type { ThemeDefaults } from '../../src/runtime/composables'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/composables/useComponentProps.spec.ts` at line 3, The spec currently imports ThemeDefaults directly from the runtime types path, which bypasses the public composables barrel and won’t catch a broken re-export. Update the import in useComponentProps.spec.ts to come through the composables index barrel so the test exercises the public API exposed by src/runtime/composables/index.ts. Keep the test using ThemeDefaults, but reference it via the barrel export to match the intended integration point.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/composables/useComponentProps.spec.ts`:
- Line 3: The spec currently imports ThemeDefaults directly from the runtime
types path, which bypasses the public composables barrel and won’t catch a
broken re-export. Update the import in useComponentProps.spec.ts to come through
the composables index barrel so the test exercises the public API exposed by
src/runtime/composables/index.ts. Keep the test using ThemeDefaults, but
reference it via the barrel export to match the intended integration point.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 74d49259-ee09-4b66-a3fa-e7ec7cf19d59
📒 Files selected for processing (6)
eslint.config.mjssrc/runtime/components/Theme.vuesrc/runtime/composables/index.tssrc/runtime/composables/useComponentProps.tssrc/runtime/types/theme.tstest/composables/useComponentProps.spec.ts
💤 Files with no reviewable changes (1)
- eslint.config.mjs
commit: |
Move ThemeDefaults/ThemeUI/ThemeContextDefaults re-export to types/index.ts where the rest of the type surface lives, instead of composables/index.ts.
🔗 Linked issue
Follow up from #6647
❓ Type of change
📚 Description
This one is also performance optimization only related to the development of Nuxt UI itself. By widening
useComponentProps's internal injection we reach the same level of module graph performance as per a downstream library using a built version of Nuxt UI.What this means in practice is that restarting Volar or the IDE while developing or testing anything in the playgrounds would result in ~2x faster cold starts and incremental evaluations.
What is not affected are CIs and anything related to UTheme, since both need to load every component anyway. While downstream performance have been mainly covered in #6646
📝 Checklist