perf(components): drop the redundant inner in component extend#228
Merged
Conversation
Port of upstream nuxt/ui 3bf1a92 (#6647).
`tv`'s `extend` accepts a raw theme object, so the inner `tv(theme)` wrapper in
`tv({ extend: tv(theme), … })` is redundant. Replace `extend: tv(theme)` with
`extend: theme` across all 162 component theme compositions. The outer
`tv({ … })(…)` call is unchanged, so `tv` stays imported and used.
Behaviour-preserving (same resolved theme); no snapshot changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream
3bf1a92—perf(components): drop the redundant inner in component extend (#6647)Change — direct 1:1 (mechanical)
Every component composes its theme as
tv({ extend: tv(theme), … })(…).tv'sextendaccepts a raw theme object directly, so the innertv(theme)wrapper is redundant:Applied to all 162 occurrences across
src/runtime/{components,components/prose,components/content,vue/overrides/*}— exactly one line per file (162 files, +162/−162). The outertv({ … })(…)call is unchanged, sotvstays imported and used. (Upstream touched 163 files; the 1-file delta is just the diverging component set.)Tests
Behaviour-preserving (identical resolved theme) → no runtime/markup change, no snapshot churn. Full suite unchanged (225 files, 5143 passed / 6 skipped).
Verify (CI=true)
dev:prepare·lint·typecheck·test·build— all green.Ledger
.sync/log/3bf1a92….md— port rationale.sync/nuxt-ui.json— add3bf1a92asport, advance cursor; reconcile prior7eab4bc→ PR perf(types): import cross-component types from source, not the barrel #227 /575c8dee. (3bf1a92itself stayspending-merge, reconciled next port.)🤖 Generated with Claude Code
Generated by Claude Code