chore(design-tokens): 🤖 add legacy backward compatibility exports for styled-components theme#971
Conversation
🦋 Changeset detectedLatest commit: eecfbd6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…-export theme hooks from design-tokens, update internal imports, deleted local files
…is properly included in the typecheck; remove legacy from package.json files
Same signature. Do ignore! |
…o call in SSR contexts
…kage includes a server-renderable component
|
Claude finished @punkbit's task in 2m 5s —— View job PR Review —
|
📚 Storybook Preview Deployed✅ Preview URL: https://click-8w20x996w-clickhouse.vercel.app Built from commit: |
Why?
To provide backward compatibility for consumer applications that depend on the legacy styled-component/javascript/typescript theme objects and theme context from
@clickhouse/click-ui. This allows gradual migration to the new CSS variable-based design tokens without breaking existing code, while making the deprecation explicit through a dedicated/legacysubpath.Warning
We're effectively dropping support for the old design token system. Source dictionary file(s) and related "generator" are purposely gone and not supported to incentivise use of the new token system.
[chore/design-tokens-package](https://github.com/ClickHouse/click-ui/tree/chore/design-tokens-package), rebase onto6385b7)🤖 TODO: Remember to re-enable
changeset:verify(in commit hook) once #951 is mergedHow?
packages/design-tokens/legacy/directory structure to host deprecated theme codepackages/click-ui/src/: Theme core, types, utils, token variable files, react hooks, etcpackage.jsonwith export pathslegacy:buildscript and updated mainbuildcommandtsconfig.legacy.jsonfor TypeScript compilation todist/legacy/LEGACY.mdwith migration examplesREADME.mdlinking to full docsContribution checklist?
buildcommand runs locallySecurity checklist?
dangerouslySetInnerHTMLPreview?
Showcase import
legacyhook fromclick-ui, same APIdemo-export-legacy-from-click-ui-design-tokensd.mov
Showcase import
legacyhook fromdesign-tokens/legacy(decoupled, Click UI can progress):demo-use-design-tokens-package-legacy-items.mov
Text example API: