feat(ui): drop shorthand classname parser — object-form css() only#2795
Merged
Conversation
Phase 4 of drop-classname-utilities:
- Delete packages/ui/src/css/{shorthand-parser,token-resolver,token-tables,utility-types,s}.ts
- Delete native/vertz-compiler-core/src/{css_diagnostics,css_token_tables}.rs
- Narrow css() and variants() public types to object form only (StyleBlock)
- Remove UtilityClass, StyleEntry, StyleValue, s, parseShorthand, resolveToken,
ShorthandParseError, TokenResolveError, InlineStyleError, isKnownProperty,
isValidColorToken from the @vertz/ui public surface
- Add packages/ui/src/__tests__/removed-exports.test-d.ts — negative type tests
that prove each removed symbol is no longer importable
- Delete migration script scripts/migrate-classnames/ (migration complete)
- Update Rust test fixtures and module_server warning tests to use surviving
diagnostics (W0763) and object-form css() sources
- Update packages/mint-docs and packages/site docs to reflect object-form only
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- B1: Delete stale NAPI tests (native/vertz-compiler/__tests__/css-transform.test.ts, css-diagnostics.test.ts) that exercised the removed shorthand parser - B2: Delete transient back-compat tests in css-object-form/variants-object-form that silently rubber-stamped invalid array-form inputs - B3: Migrate all user-facing docs and READMEs from array-form to object-form + token.* (mint-docs, site, ui README, ui-primitives README) - S1: Update packages/ui/AUDIT-ARCHITECTURE.md to reflect current CSS architecture (remove references to deleted token-tables/token-resolver/shorthand-parser) - S2: Update packages/ui-primitives/README.md example to object-form - S3: Restore collision detection in compileTheme() without depending on the deleted COLOR_NAMESPACES table — throws on duplicate --color-* var names Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Apr 19, 2026
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.
Summary
Phase 4 (final phase) of the drop-classname-utilities feature. Removes the legacy string-shorthand classname parser (
['p:4', 'bg:background']) now that all call sites have been migrated to object-formcss()+token.*.Public API Changes
Breaking (pre-v1)
@vertz/ui:s,UtilityClass,StyleEntry,StyleValue,parseShorthand,resolveToken,ShorthandParseError,TokenResolveError,InlineStyleError,isKnownProperty,isValidColorTokencss-unknown-property,css-invalid-spacing,css-unknown-color-token,css-malformed-shorthandcss()andvariants()now accept object-form only (StyleBlock). Array-form input no longer type-checks and is not extracted by the compiler.Additions
Migration
Already performed across first-party packages in Phase 3 (#2792). External users should migrate:
Deletions
TypeScript:
packages/ui/src/css/shorthand-parser.ts(~3.5 KB source)packages/ui/src/css/token-resolver.ts(~18 KB source)packages/ui/src/css/token-tables.ts(~18.6 KB source)packages/ui/src/css/utility-types.ts(~6.3 KB source)packages/ui/src/css/s.ts(~2 KB source)scripts/migrate-classnames/(migration tool — migration complete)Rust:
native/vertz-compiler-core/src/css_diagnostics.rsnative/vertz-compiler-core/src/css_token_tables.rsTests:
native/vertz-compiler/__tests__/css-transform.test.tsandcss-diagnostics.test.ts(exercised removed parser)css-object-form.test.ts/variants-object-form.test.tsAdditions
packages/ui/src/__tests__/removed-exports.test-d.ts— 11 negative type tests proving each removed symbol is no longer importable from its former export paths.compileTheme()regains a collision detector (Map-based) that throws when two color token paths would produce the same--color-*CSS variable (e.g.primary.foregroundvsprimary-foreground). Replaces the older check that depended on the deletedCOLOR_NAMESPACEStable.Phases
css()end-to-end (PR feat(ui): drop classname utilities — object-form css() + token.* helper #2769)token.*helper + typed augmentation (included in feat(ui): drop classname utilities — object-form css() + token.* helper #2769)Review
Local adversarial review at
reviews/drop-classname-utilities/phase-04-delete.md. Three blockers (stale NAPI tests, transient back-compat tests, docs still teaching the removed API) and three should-fix items (architecture doc, ui-primitives README, theme collision regression) all addressed in follow-up commits.Test plan
@vertz/ui— 2315 tests pass@vertz/theme-shadcn— 136 tests pass@vertz/ui-auth— 70 tests passpackages/uitypecheck clean (tsgo --noEmit)cargo test --allpassescargo clippy --all-targets -- -D warningscleancargo fmt --all -- --checkcleanoxlint packages/— 0 errorsoxfmt --check packages/clean🤖 Generated with Claude Code