Repository navigation
chore(deps): tailwind-variants 4.0.2 on its lite runtime - #438
Merged
Merged
Conversation
4.0 drops the tailwind-merge peer and bundles its own merge engine with compiled tables in the default entry. Imported as before, that entry put both eager graphs 4.0 KiB gzipped over main (standalone 337.4, embed 338.5 shipped, against a 336 budget). Every recipe now takes `tv` from `src/styles/tv.ts` instead: the lite runtime, merging through the tailwind-merge 3.7.0 already in the tree, which the migration guide documents for an app that keeps its merger. That costs +1.3 KiB per graph (334.7 / 335.8 shipped; loader unchanged at 3.3). Every recipe's class strings are unchanged. Checked by recording all 21 recipes over every variant combination and slot (6,726 outputs) before and after: the only difference is that a slot with no classes now returns "" where 3.3.1 returned undefined, and no rendered slot is empty. Every Ladle story, light and dark, renders the same class attribute on all 19,494 elements in Chromium. tailwind-merge 3.7.0 and 3.3.1's built-in engine agree on 83.6M ordered pairs of this codebase's class tokens except 42, where a later px/mx/inset-x now drops an earlier ps/pe/ms/me/start/end; no recipe or call site puts those in that order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
The package entry bundles a second merge engine, 2.7 KiB gzipped on both eager graphs, and a recipe built on it would also resolve conflicts with a different engine from every other recipe. `src/styles/tv.ts` is the one import; its `tailwind-variants/lite` path is not restricted. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
…e one The guard named only the package entry, so `tailwind-variants/lite`, the specifier `src/styles/tv.ts` itself uses, linted clean everywhere. Bare lite's `tv` merges nothing: a recipe built on it ships a variant's or a caller's `px-6` beside its base `px-2`, and size and typecheck stay green. A pattern over the package and every subpath now refuses all of them, with one narrow disable on the sanctioned import. The old message priced the default entry at 2.7 KiB. That is the gap between the two whole-app setups; one stray default-entry import beside the lite pairing measured +12.0 KiB on both eager graphs (standalone 346.7, embed 347.7 shipped), so the message drops the number. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
tailwind-variants 3.3.1 shipped its own frozen copy of the merge engine, so the caret on tailwind-merge moved nothing at runtime. Through `src/styles/tv.ts` it is now the engine for every recipe, and a routine minor bump could change conflict resolution across the UI with every gate green: the step from 3.3.1's copy to 3.7.0 alone changed 42 token pairs. The pin matches tailwind-variants and tailwindcss beside it. Only the importer specifier changes in the lockfile; 3.7.0 stays resolved. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
The bullet priced the default entry at 2.7 KiB, which is the gap between two whole-app setups, not the cost of the stray import it warns against (about 12 KiB beside the lite pairing). It also missed that bare `lite` merges nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Ardnived
approved these changes
Nov 19, 2026
Contributor
Author
|
🤖 no session running Written by the sydevs dispatcher. Sessions never edit this comment. |
This was referenced Nov 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
This upgrades tailwind-variants from 3.3.1 to 4.0.2, the current
latest, pinned exactly. Every recipe now takestvfrom a newsrc/styles/tv.ts: the package's lite runtime (createTV({ twMerge })fromtailwind-variants/lite), merging through tailwind-merge 3.7.0, whichpackage.jsonalready listed. Every recipe's class strings are unchanged, and every gate passes at the existing budgets.What changed and why it matters
The upgrade itself. 4.0 makes these changes:
twMergeConfigmoved to/configexperimentalParseClassNamewas removed""twMergefunction you pass itOnly the empty-string change shows up in this codebase.
Why the lite route. A plain upgrade that keeps importing
tvfrom the package entry bundles v4's own merge engine and its compiled tables. That pushed both eager graphs over budget: standalone 337.4 and embed 338.5 KiB shipped, against 336. The lite runtime with an injected merger is the setup v4's migration guide documents for an app that keeps its own merger. It costs +1.3 KiB per graph instead.17 modules now import
tvfrom@/styles/tv.Lint refuses every
tailwind-variantsentry insrc/, through ano-restricted-importspattern covering the package and every subpath.src/styles/tv.tsis the one importer, with one narrow, commented disable. Covering/litematters: bare lite'stvmerges nothing, so a variant's or caller'spx-6would ship beside the basepx-2, with size and typecheck both green.tailwind-mergeis pinned exactly to 3.7.0. tailwind-variants 3.3.1 shipped its own copy of the merge engine, so the old caret had no runtime effect. tailwind-merge now resolves conflicts for every recipe, and a routine minor bump could change that across the UI with no gate noticing. The lockfile diff is the specifier only.Docs. DESIGN_SYSTEM.md (Styling) and
src/components/AGENTS.mdnow name the import path. Neither stated a version or an API that 4.0 changed.No CHANGELOG or
docs/embedding.mdentry. Nothing host- or visitor-observable changed: no origin, CSP, attribute or class output.Verification
.claude/skills/pr-prep/check.sh --full: PASS.assert:cssreports 1213 rules, 62@propertyand 775var()refs, the same as main.assert:mapsandassert:classicpass.pnpm size.pnpm ladle:build: PASS (168 files, no source maps).pnpm check:wrangler: PASS (both configs, dry run).tv()recipes and recorded every variant combination, each value plus unset, for every slot: 6,748 lines.""instead ofundefined. No call site renders any of them.classattribute on both sides and diffed them. Every pass found 0 class differences; the only differences were noise that main reproduces against itself.px/mx/inset-xdropping an earlierps/pe/ms/me/start/end. No recipe or call site puts them in that order today.tailwind-variants/lite,/configand/mergeimports linted clean; after it, they error. The bare entry, type-only imports andexport … fromare refused too. ThereaddirSyncrestriction (test(build): one source walker for the nine specs that inventorysrc/#286) still fires.pnpm sizefails.VariantPropsfor Button and Drawer stay exact unions on v4.Not done / not verified
package.jsonspecifier. The recipe recorder shows byte-identical output, and the bundle size is unchanged.review:embedhost pages, which need a SahajCloud backend that accepts the key.px-*on the left Drawer's content slot now drops itsps-[env(safe-area-inset-left,0px)]; under 3.3.1, only a callerp-*orps-*did. ToggleGroupItem's-ms-pxagainst a callermx-*is the same case. No caller passes either today. Fixing it means changing the Drawer's class strings, which is out of scope for an upgrade that must keep them unchanged."tailwind-variants": "4.0.2"was published 2026-11-10. CI's Dependency Review will see it.Follow-ups for the maintainer
mainis 0.2 KiB of 336, so the next small eager addition tripspnpm size. The tech-debt PR fromclaude/lucid-brahmagupta-0v1c16frees roughly 45 KiB of eager payload; landing it first removes the squeeze.pb-*. A callerp-*/px-*could then never erase it.8d979f6still quotes a misleading 2.7 KiB figure, which later commits correct in the code and docs. Word the squash message from this description.3d9c45d.mainhas since gained5ce0f21(chore(contracts): re-sync copied contracts from SahajCloud #434,payload-types.tsonly, no overlap). The lockfile change is limited to tailwind-variants and the tailwind-merge specifier, so other dependency PRs may conflict on those lines only..claude/change is needed.Generated by Claude Code