Skip to content

feat(cva): support internal variants prefixed with _#382

Draft
joe-bell wants to merge 1 commit into
mainfrom
claude/jb-384-schema-impl-3qh7mm
Draft

feat(cva): support internal variants prefixed with _#382
joe-bell wants to merge 1 commit into
mainfrom
claude/jb-384-schema-impl-3qh7mm

Conversation

@joe-bell

Copy link
Copy Markdown
Owner

Variant names starting with _ are now internal: still declarable in
variants, settable via defaultVariants, and matchable in
compoundVariants, but hidden from the component's props type and
from getSchema (both its return type and runtime object). Hiding is
type-level only, so an untyped caller can still resolve one directly.

This is a breaking change for any config that already used a
_-prefixed variant name as a public prop; those variants disappear
from prop types and getSchema results, though their runtime class
resolution is unaffected. Documented in variants.mdx, api-reference.mdx,
and flagged in whats-new.mdx.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01ALpEtdErxKFkdm3jhvSjmS

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cva d5eb7a9 Commit Preview URL

Branch Preview URL
Jul 12 2026, 06:54 PM

@joe-bell

Copy link
Copy Markdown
Owner Author

Unsure about this approach, would an internalVariants key be better 🤔

@joe-bell joe-bell marked this pull request as draft July 10, 2026 17:15
@joe-bell joe-bell force-pushed the claude/jb-384-schema-impl-3qh7mm branch from c260801 to 4c7bec6 Compare July 11, 2026 15:14
@cursor cursor Bot force-pushed the claude/jb-384-schema-impl-3qh7mm branch from 4c7bec6 to 493138d Compare July 12, 2026 10:42
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Benchmarks

Comparing this PR's local benchmark run against the latest published npm versions.

Aim for higher ops/s. Treat deltas within ±5% as noise.

class-variance-authority

Task This PR 0.7.1 Δ
cva (runtime)
component call with defaults
1,138,165 ops/s ±0.12% 1,111,138 ops/s ±0.29% +2.4%
cva (runtime)
component call with props
178,275 ops/s ±0.27% 190,144 ops/s ±0.33% 🔴 -6.2%
cx (runtime)
class join
12,262,745 ops/s ±0.37% 12,636,414 ops/s ±1.72% -3.0%
cva (static)
component definition
24,983,440 ops/s ±0.22% 22,957,015 ops/s ±0.60% 🟢 +8.8%
compose (static + runtime)
define, join and call
944,171 ops/s ±0.39% 935,170 ops/s ±0.91% +1.0%

cva

Task This PR 1.0.0-beta.6 (beta) Δ
cva (runtime)
component call with defaults
1,110,925 ops/s ±0.18% 1,147,788 ops/s ±0.63% -3.2%
cva (runtime)
component call with props
176,792 ops/s ±0.17% 176,395 ops/s ±0.54% +0.2%
cx (runtime)
class join
11,153,386 ops/s ±0.11% 8,983,262 ops/s ±0.52% 🟢 +24.2%
cva (static)
component definition
4,051,796 ops/s ±0.80% 3,834,469 ops/s ±1.59% 🟢 +5.7%
composes property (static + runtime)
define, join and call
449,454 ops/s ±0.23% 454,774 ops/s ±0.37% -1.2%

Commit e1d355b · Node v24.18.0 · linux x64 · 2026-07-12T18:54:24.986Z

These benchmarks ran in CI on this PR's code. The comment checks that the report looks valid before posting it, but it cannot guarantee the numbers are correct. If you see a large change, re-run the benchmarks locally before treating it as a real improvement or regression.

Variant names starting with `_` are now internal: still declarable in
`variants`, settable via `defaultVariants`, and matchable in
`compoundVariants`, but hidden from the component's props type and
from `getSchema` (both its return type and runtime object). Hiding is
type-level only, so an untyped caller can still resolve one directly.

This is a breaking change for any config that already used a
`_`-prefixed variant name as a public prop; those variants disappear
from prop types and getSchema results, though their runtime class
resolution is unaffected. Documented in variants.mdx, api-reference.mdx,
and flagged in whats-new.mdx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALpEtdErxKFkdm3jhvSjmS
@cursor cursor Bot force-pushed the claude/jb-384-schema-impl-3qh7mm branch from 493138d to d5eb7a9 Compare July 12, 2026 18:52
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