Skip to content

v0.8.0

Choose a tag to compare

@mareszhar mareszhar released this 06 Oct 06:09
· 3 commits to main since this release

Summary

Vanity's layer order now travels with its CSS. Component rules keep their intended precedence even when their stylesheet arrives before the system stylesheet. Configured layer roots also work in Nuxt, and development edits retire old Vite stylesheets after each page installs their replacements. Overlapping saves avoid errors from outdated system inputs, while genuine failures stay visible and repair reliably.

Fixed

  • Repository tooling typechecks from a clean checkout before the SDK is built.
  • Component rules retain their rank above lower system layers, such as a reset, regardless of stylesheet delivery order. This includes Nuxt development, where stylesheets for other routes can arrive first.
  • compiler.layerOrder takes effect in Nuxt development and builds.
  • Development edits that reorder layers or remove rules take effect after replacement CSS is installed. Compatible edits keep the page and runtime state; application-imported runtime identity changes, root-order changes, and configured-system recovery retain the reload boundary.
  • Repairing a failed configured system reloads the page once, after all replacement CSS is ready.
  • Overlapping system and stylesheet saves use the latest system, avoiding spurious missing-token errors and stale exported values. Genuine failures remain visible and identify any retained CSS as excluding the failed edit.
  • Repairing overlapping failures installs current CSS for every consumer, including stylesheets an earlier failed update had already compiled.
  • System edits update stylesheets previously requested only by SSR without Vite's misleading “outdated pre-bundle” error.
  • Complete layer headers survive repeated compilation through cached systems, including independently bundled authoring code.
  • Invalid layer or axis names, repeated CSS identities, and axes sharing a generated control attribute fail locally with an authored diagnostic instead of silently losing rules or coupling controls.
  • Escaped axis names generate matching CSS selectors and DOM/SSR attributes, including native color-scheme controls and quoted names. Authored keys stay intact.
  • Axis and mode keys such as constructor and __proto__ survive composition, token branches, native JSON, and restored runtime selection as own data. Independent systems keep independent branch data.
  • Direct and detached axis configurations preserve derive callbacks and native policy, with contextual callback parameters and inferred branches. Authored mode values still win over derivations.
  • Axis types expose only capabilities their configuration guarantees. Optional derivations and callbacks returning undefined remain usable without promising an absent branch.
  • Reused plugin instances keep the correct layer-order asset across successive Vite HTML builds. Builds without listed layers skip asset-owner lookup, including overlapping builds on Vite 6.
  • Token rename stays within its originating graph, including builder keys whose literal spelling also appears in unrelated graphs or types.
  • Accepting the editor’s type-only declaration import clears its ambient-source notice; unrelated imports leave the notice intact.
  • Authoring tests run through the application’s mounted Vite configuration on Vitest 5.
  • $case() preserves the selected case's value type in build and runtime handles. Dynamic addresses retain their possible values, reservations remain undefined, and extra address keys are rejected.
  • Extracted case selectors can be exported by declaration-emitting libraries. Runtime projection types share token identities across the core and runtime entrypoints, preserving cases and setters.
  • Runtime custom-property helpers accept typed values created through the core entrypoint. bindPort() accepts narrow ports and preserves their declaration types.
  • Token hovers show resolved public traits without repeating the system's token-definition and axis configuration types.
  • Constructor, explicit-unit, composition, recipe, anatomy, port and runtime-control documentation survives native member completion, including published declarations. Port guidance describes dec() and the actual metadata behavior.
  • Incompatible calculation sums name the dimensions and suggest compatible operands at the offending value; signature help explains the active operand. Known unions with a possible incompatible dimension require narrowing before the sum.
  • Agent-context field documentation explains semantic paths, emitted contexts, portability and defaults. The guide distinguishes focused explanation from complete token-vocabulary context.

Added

  • VANITY_SYSTEM_INVALID_LAYER identifies invalid system layer names, including empty entries in policies.layerOrder.

Changed

  • Repository spike experiments share the workspace dependency catalog and lockfile, including Selenita 0.3 and Vitest 5. Version-specific Vite 6 host evidence keeps an explicit host pin.
  • Compiler dependencies are refreshed, including OXC’s TypeScript parser fixes. Ordinary styling peer ranges are unchanged; editor-DX testing now uses Selenita 0.3.
  • compiler.layerOrder entries must be complete CSS identifiers with unique decoded identities. Equivalent escape spellings name one layer; omitted configured roots follow in configuration order.
  • Without compiler.layerOrder, plain Vite adds no document-first root-order stylesheet. Vanity's rank among other layered CSS follows stylesheet order.
  • The linked layer-order stylesheet is content-hashed under build.assetsDir.
  • Every Vanity stylesheet opens with the layer statements it needs to preserve system and host-root order.
  • VanityOpenAxisConfig and VanityAxisConfig require control and derive when their type arguments guarantee those capabilities. Optional fields and derivations that may omit results guarantee no activation or branch.
  • The testing kit returns reusable Selenita configuration through createVanityProjectConfig(), composed with Selenita’s defineProject() or createProject(). Fixture helpers come directly from Selenita.

Upgrade notes

  • If your application mixes Vanity with other layered CSS and relies on their relative rank, list those roots in compiler.layerOrder, for example ['app', 'theme', 'base', 'components', 'utilities'].
  • Rename rejected layer or axis names and remove repeated CSS identities. Empty policies.layerOrder entries now report VANITY_SYSTEM_INVALID_LAYER instead of VANITY_POLICY_INVALID.
  • Rename one axis if two names generate the same control attribute, such as colorScheme and color-scheme.
  • Regenerate portable artifacts for escaped axis names: their generated attributes and identities now reflect the decoded name.
  • Regenerate artifacts for axis/mode keys previously lost to inherited JavaScript members: restoring their own metadata can change compatibility and runtime identities.
  • Regenerate artifacts for direct configurations whose derive or native field was ignored: preserving those fields can change CSS, compatibility, and runtime identities. Ordinary names and already-preserved configurations retain their identity bytes.
  • Supply control or derive when explicitly annotating known capabilities. Inference or satisfies preserves supplied fields and callback results. Author a mode value or narrow its derivation before treating an optional branch as guaranteed.
  • TypeScript still counts inherited members as structure. A sparse literal that omits a declared constructor or toString can fail assignability even though it is valid at runtime.
  • Remove a Nuxt app.head layer statement added as a workaround and use compiler.layerOrder.
  • For editor-DX tests, update to Selenita 0.3 and Vitest 5. Replace defineVanityProject(options) with defineProject(createVanityProjectConfig(options)), importing defineProject from @mszr/selenita/vitest. Standalone tools use core createProject() and own disposal. The testing-kit guide shows setup and lifecycle.
  • Import cursor, mark, snippet and the project constructor from the same Selenita entrypoint; the testing kit no longer re-exports fixture helpers.
  • Replace old completion matchers with toSuggest()/toSuggestOnly(), and groups with scoped snippets plus atEach(). A negated toSuggest() list rejects every listed name. Selenita supplies its own TypeScript 6 editor backend, independently of Vanity’s compiler tooling.