|
| 1 | +# @arijs/bootswatch-ve v0.2.1 |
| 2 | + |
| 3 | +Shared Bootstrap state classes are now one contract each, composed at the call site. 35 per-family state aliases are gone — 18 of them had shipped with no CSS behind them since the package existed. |
| 4 | + |
| 5 | +> **Read this before upgrading.** Despite the patch number, this release removes exported names. `^0.2.0` resolves to it automatically, and a project using any of the removed names will fail to compile. The failure is a compile error, not a silent visual regression — see *Migrating* below. |
| 6 | +
|
| 7 | +## Why |
| 8 | + |
| 9 | +`dropdownItemActive`, `listGroupItemActive` and two siblings were exported, hashed, and referenced by none of the 27 themes. Applying one was a silent no-op: correct import, valid TypeScript, a real class in the DOM, and zero CSS behind it. |
| 10 | + |
| 11 | +They were not an oversight. A per-family alias collapses a compound source selector into one identifier — `.dropdown-item.active` → `dropdownItemActive`, `.btn.show` → `btnShowHook`. 33 identifiers stood for 9 Bootstrap state classes, and each one only existed in the CSS because someone hand-wrote an entry in the converter's divergence manifest. Families without a demo page never got an entry, so 18 of the 33 shipped dead. |
| 12 | + |
| 13 | +The alias bought nothing: `${navLink}${navLinkActive}` and `${navLink}${active}` have identical specificity and match the same elements. Compound selectors already isolate components — `${modal}${show}` cannot match a dropdown — so a shared `active` is safe. |
| 14 | + |
| 15 | +## Breaking changes |
| 16 | + |
| 17 | +**35 exported names removed.** Compose the shared state contract instead: |
| 18 | + |
| 19 | +```ts |
| 20 | +// before |
| 21 | +import { dropdownItem, dropdownItemActive } from '@arijs/bootswatch-ve/dropdowns' |
| 22 | +cx(dropdownItem, isActive && dropdownItemActive) |
| 23 | + |
| 24 | +// after |
| 25 | +import { dropdownItem } from '@arijs/bootswatch-ve/dropdowns' |
| 26 | +import { active } from '@arijs/bootswatch-ve/global' |
| 27 | +cx(dropdownItem, isActive && active) |
| 28 | +``` |
| 29 | + |
| 30 | +| entry | removed | replace with | |
| 31 | +|---|---|---| |
| 32 | +| `accordion` | `accordionButtonCollapsed`, `accordionCollapseShow`, `accordionCollapsing` | `collapsed`, `show`, `collapsing` | |
| 33 | +| `alerts` | `alertBtnCloseDisabledHook` | `disabled` | |
| 34 | +| `breadcrumb` | `breadcrumbItemActive` | `active` | |
| 35 | +| `buttons` | `btnActiveHook`, `btnDisabledHook` | `active`, `disabled` | |
| 36 | +| `carousel` | `carouselActive`, `carouselItemActive`, `carouselIndicatorActive` | `active` | |
| 37 | +| `dropdowns` | `btnShowHook`, `dropdownMenuShow`, `dropdownItemActive`, `dropdownItemDisabled` | `show`, `show`, `active`, `disabled` | |
| 38 | +| `list-group` | `listGroupItemActive`, `listGroupItemDisabled` | `active`, `disabled` | |
| 39 | +| `modal` | `modalShowHook`, `modalFade` | `show`, `fade` | |
| 40 | +| `navbar` | `collapseShow` | `show` | |
| 41 | +| `navs` | `navLinkActive`, `navLinkDisabled`, `tabPaneActive`, `navItemShow` | `active`, `disabled`, `active`, `show` | |
| 42 | +| `pagination` | `pageItemActive`, `pageItemDisabled` | `active`, `disabled` | |
| 43 | +| `popovers` | `popoverShow`, `popoverFade`, `popoverVe` | `show`, `fade`, `popover` | |
| 44 | +| `toasts` | `toastShow`, `toastShowing`, `toastFade`, `toastHide` | `show`, `showing`, `fade`, — | |
| 45 | +| `tooltips` | `tooltipShow`, `tooltipFade`, `tooltipVe` | `show`, `fade`, `tooltip` | |
| 46 | + |
| 47 | +`active`, `disabled`, `show`, `showing`, `fade`, `collapsed` and `collapsing` all come from `@arijs/bootswatch-ve/global`. `popover` and `tooltip` come from their own entries — the templates already stamped them alongside the `*Ve` aliases, so dropping those changes nothing visually. |
| 48 | + |
| 49 | +`toastHide` has no replacement: `.hide` has no rule in any theme's `bootstrap.css`, so there was never anything to map it to. Bootstrap's own literal `'hide'` is used for `CLASS_NAME_HIDE`. |
| 50 | + |
| 51 | +**91 class hashes changed.** Removing an export shifts Vanilla Extract's per-file identifier counter, so the contracts declared after it in the same module get new hashes — `dropdownItem`, `modal`, `carouselItem` and 88 others. Names and CSS ship together, so importing the name keeps working; this only matters if you hardcoded a hash string somewhere. |
| 52 | + |
| 53 | +## Fixed |
| 54 | + |
| 55 | +- **`badgeInfo` and `badgeWarning` are exported again.** Superhero is the only theme that still carries the Bootstrap 3/4 `.badge-info` / `.badge-warning` rules, and the contract builder decided liveness by looking at the `bootstrap` theme alone — so both names were dropped from the package as dead duplicates. Liveness is now the union of all 27 themes. |
| 56 | +- **`containerFluid` pointed at a dead hash.** The contract builder collected modules by filename and skipped `layout/container.css.ts`, so the name resolved to the unstyled copy in the literal registry while the themes styled the layout one. |
| 57 | +- **Utility CSS never loaded in granular mode.** 350 components requested a `utilities/used` family that had been retired, and an unknown family is a silent no-op outside DEV, so no utility rule was fetched on any route. Visible wherever a utility drove layout — `.flex-wrap` on a wrapping pagination, `.mb-3` losing to `.nav { margin-bottom: 0 }`. |
| 58 | + |
| 59 | +## Guard rails |
| 60 | + |
| 61 | +An exported contract with no CSS behind it can no longer reach npm. |
| 62 | + |
| 63 | +- `npm run check:contract-wiring` — static, runs before a build; also checks that every class token in the source themes maps to a declared contract. |
| 64 | +- `build-contract.mjs` now asserts liveness for every exported name against the emitted CSS. It previously only checked names declared by two modules, which is exactly how the four dead contracts got published. |
| 65 | +- Deliberate inertness is declared in `scripts/contract-wiring-allowlist.mjs` with a reason. A state hook is never a valid entry there. |
| 66 | + |
| 67 | +Dead exports in the package: **90 → 68**, all allowlisted (element markers, Bootstrap 3/4 names BS5 dropped, demo scaffolding, and 14 tagged `TRIAGE` pending a decision from whoever knows the original intent). |
| 68 | + |
| 69 | +## Verification |
| 70 | + |
| 71 | +- **Rule-set equivalence across all 27 themes.** Every `globalStyle` in the generated family chunks, with the old aliases normalised to the literal contracts they stood for: **0 distinct rules dropped, 0 added**. Raw rule count falls by exactly 11 per theme — the duplicated mirror rules collapsing into the generic one. |
| 72 | +- **Screenshots, granular loader, baselines recaptured with the same browser:** bootstrap 333/339 and darkly 119/119, zero mismatches, most at `0.000000`. The 6 skipped are routes whose `@screenshot` directive height is pinned to a browser build the verification container does not have. |
| 73 | +- 27 themes, 31 contract entries, 2209 exported classes, 0 residual literal `--bs-*`. |
0 commit comments