Skip to content

fix: component loading 10 -> 45 via registry scanning#40

Merged
ssilvius merged 3 commits intomainfrom
feat/fix-jsx-blockers
Apr 1, 2026
Merged

fix: component loading 10 -> 45 via registry scanning#40
ssilvius merged 3 commits intomainfrom
feat/fix-jsx-blockers

Conversation

@ssilvius
Copy link
Copy Markdown
Contributor

@ssilvius ssilvius commented Apr 1, 2026

Summary

  • Relaxed MissingVariants gate to allow components with base_classes or size_lookup but no variant records
  • Added nested object class extraction for components like checkbox, slider, switch
  • Added fallback scanning for structural components exporting individual *Classes constants without the {prefix}VariantClasses convention
  • Component loading: 10 -> 45 (38 with real previews, 7 load but fall back to passthrough)

Test plan

  • 175 tests passing
  • Clippy clean
  • Visual verification of generated component pages

🤖 Generated with Claude Code

ssilvius and others added 3 commits March 31, 2026 12:51
Two blockers prevented veneer from rendering most rafters component
previews. Multi-element JSX code blocks (common in docs) caused
oxc_parser panics because adjacent JSX elements are not valid JS.
Fixed by wrapping in a fragment before parsing. The registry only
scanned for variantClasses in .tsx files, missing the 44 .classes.ts
files where rafters stores its class definitions. Scanner now reads
.classes.ts with prefix-derived conventions. Components without
variant records get passthrough Web Components for static previews.
Coverage goes from 8 to 59 of 60 component docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three fixes to the component registry scanner:

1. Relax MissingVariants gate: Components with base_classes or
   size_lookup (but no variant records) now register. This picks up
   structural components like avatar, card, empty, item, kbd.

2. Handle nested object variants: extract_object_entries now
   concatenates string values from nested objects like
   { border: 'border-primary', checked: 'bg-primary' }. This picks
   up checkbox, slider, switch.

3. Fallback class extraction: .classes.ts files that export individual
   class constants (accordionItemClasses, dialogOverlayClasses, etc.)
   without matching {prefix}VariantClasses conventions now register
   via extract_all_exported_classes fallback.

Verified: `veneer build` from rafters loads 45 components (was 10).
All 167 tests pass, clippy clean, fmt clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ssilvius ssilvius merged commit 00dd754 into main Apr 1, 2026
7 checks passed
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.

1 participant