v2.0.0
Major Changes
-
#123
f26409eThanks @tenphi! - Unified hash-based class names across RSC, SSR, and client. Same cache key now produces the same class name in all environments, enabling cross-environment style deduplication. Replaces the heavy SSRCacheState transfer with a lightweight class-name-list viawindow.__TASTY__.SSR/RSC fixes included:
- Fix missing tokens on pages without RSC-rendered tasty components. The
globalThis.__tasty_rsc_internals_emitted__flag leaked across requests in the same Node.js process; internals (tokens,@property,@font-face,@counter-style) are now emitted exclusively by the SSR collector. - Fix duplicate global CSS when RSC and SSR paths both emit internals in Next.js App Router. The SSR collector now skips internals already emitted by the RSC inline-style path.
- Fix CSS class name collisions during client-side navigation in Next.js App Router. RSC inline styles used sequential counters (
r0,r1, …) that reset on every request; replaced with content-based hashing (djb2) so identical content always maps to the same name. - Auto-skip global CSS injection on client when
<style data-tasty-ssr>is detected, eliminating the need fortypeof window === 'undefined'guards inconfigure()calls.
Internal SSR API changes (not part of the public API):
SSRCacheStatetype removed — replaced by plainstring[]class lists.ServerStyleCollector.getCacheState()replaced bygetRenderedClassNames().window.__TASTY_SSR_CACHE__replaced bywindow.__TASTY__.hydrateTastyCache()deprecated in favor ofhydrateTastyClasses()(the old function still works as a compat shim).- Class name format changed from
t{number}tot{base36hash}.
- Fix missing tokens on pages without RSC-rendered tasty components. The
Minor Changes
- #119
af8bf8aThanks @tenphi! - AddpresetsandglobalStylesoptions toconfigure().presetsis a shorthand forgenerateTypographyTokens()that merges generated tokens under explicittokens.globalStylesis aRecord<string, Styles>that applies Tasty styles to arbitrary CSS selectors across all rendering modes. Both options are also available in plugins and zero-runtime config. Typography preset fields now accept state maps for responsive/theme-aware values.
Patch Changes
-
#119
8a7a342Thanks @tenphi! - DeriveTastyZeroConfigfromTastyConfigviaOmitto keep the two types in sync automatically. This also widensTastyZeroConfigto acceptcolorSpace,properties, andbooleanvalues inreplaceTokens— options that were previously only available in the runtime config. -
#123
841767cThanks @tenphi! - Fix overlapping and duplicate CSS selectors produced by the condition simplifier.- Fix overlapping selectors when default and custom-state token values coincide but other state values differ.
- Fix overlapping selectors for compound state tokens by adding consensus resolution and making inner OR branches exclusive during CSS materialization.
- Fix complementary factoring for compound state conditions, eliminating duplicate selectors when token values match across state combinations.
- Eliminate duplicate token CSS rules when multiple states map to the same value. Tokens now generate a single rule instead of redundant duplicates. Also fixes absorption law so
A | (A & B)correctly simplifies toAregardless of condition complexity.
-
#119
a642337Thanks @tenphi! - Change defaultletterSpacingin typography presets from'0'to'normal'. The previous default could override inherited letter-spacing;'normal'matches the browser default.