Skip to content

fix(theme): preserve deprecated target compatibility - #6126

Merged
cixzhang merged 5 commits into
mainfrom
fix/remove-deprecated-theme-targets
Sep 11, 2026
Merged

fix(theme): preserve deprecated target compatibility#6126
cixzhang merged 5 commits into
mainfrom
fix/remove-deprecated-theme-targets

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Why

Theme consumers may still use deprecated component target keys. Removing those aliases would silently break working themes, so this change keeps compatibility while steering new theme authoring to canonical keys.

What

  • Keeps all deprecated runtime aliases and discovery entries supported, with exact canonical replacement metadata.
  • Labels deprecated targets in CLI and docsite discovery, warns during theme builds, and excludes deprecated keys from copyable new examples.
  • Canonicalizes maintained themes and templates while preserving both deprecated and canonical behavior through focused tests.

Risk

Non-breaking. Existing deprecated target keys continue to work; canonical keys remain the preferred path for new themes.

Testing

  • pnpm check:knowledge
  • Focused Core compatibility suites for all deprecated aliases
  • CLI discovery, build-warning, and formatting suites
  • Docsite test suite
  • Full GitHub CI

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 11, 2026 2:36am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 7, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Sep 7, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 7, 2026
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from 9bf1e8e to 7d3f245 Compare September 7, 2026 17:14
@cixzhang
cixzhang marked this pull request as ready for review September 7, 2026 17:15
github-actions Bot added a commit that referenced this pull request Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Banner (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 428 -
Complexity N/A Very High (44) -
CodeBlock (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1569 -
Complexity N/A Very High (83) -
DateInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3305 -
Complexity N/A Very High (359) -
DateRangeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 539 -
Complexity N/A Very High (66) -
DateTimeInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 3393 -
Complexity N/A Very High (530) -
Field (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 819 -
Complexity N/A Very High (56) -
FormLayout (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 93 -
Complexity N/A Low (3) -
HoverCard (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 667 -
Complexity N/A Very High (95) -
Indicator (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 563 -
Complexity N/A High (26) -
MultiSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1655 -
Complexity N/A Very High (231) -
NavIcon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 50 -
Complexity N/A Low (1) -
Popover (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 757 -
Complexity N/A Very High (82) -
ProgressBar (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 397 -
Complexity N/A High (29) -
Selector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1992 -
Complexity N/A Very High (218) -
StatusDot (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 134 -
Complexity N/A Medium (7) -
Table (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1960 -
Complexity N/A Very High (112) -
TextArea (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 435 -
Complexity N/A Very High (65) -
TextInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 341 -
Complexity N/A Very High (59) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: 2 accessibility violation(s) found — 1 critical, 1 serious.

DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/20 stories · Learn more
    • WCAG: 4.1.2 (Level A)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

Status: Skipped — Broad stable scope is deferred to the daily release gate. It covers 382 trusted baseline shots instead of recapturing them for this PR. View the report


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from 7d3f245 to a4d41a7 Compare September 8, 2026 01:22
@cixzhang
cixzhang changed the base branch from main to fix/remove-bare-theme-classes September 8, 2026 01:22
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from a4d41a7 to b3bd763 Compare September 8, 2026 01:23
@cixzhang
cixzhang force-pushed the fix/remove-bare-theme-classes branch from 0978503 to 98a4ed1 Compare September 8, 2026 01:31
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from b3bd763 to 942fe53 Compare September 8, 2026 01:32
@cixzhang
cixzhang changed the base branch from fix/remove-bare-theme-classes to main September 8, 2026 01:32
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from 942fe53 to fc448aa Compare September 8, 2026 01:33
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from fc448aa to 0221c55 Compare September 8, 2026 02:07
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from 0221c55 to 2dcd0d2 Compare September 8, 2026 02:45
@cixzhang
cixzhang changed the base branch from fix/remove-bare-theme-classes to main September 9, 2026 12:12
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from 3e1033c to f34f299 Compare September 9, 2026 12:12
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from f34f299 to 67392df Compare September 9, 2026 12:30

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic verdict: approve

Theme builders now get one canonical target vocabulary without losing the generic compatibility mechanisms needed for future staged aliases.

  • All 21 retired keys have exact replacements shared by discovery, the codemod, diagnostics, and documentation; collisions preserve both declarations with an actionable TODO.
  • Maintained published themes and bundled templates use canonical keys only, and build validation covers root, light/dark, and ordered adaptation rules.
  • legacyNames, ThemePropsOptions, deprecatedFor, and InputClearButton.iconClassName remain available. The docsite labels staged aliases but excludes them from copyable examples.

Independent exact-head semantic review found no blocking issue. Local full repository and docsite builds, typechecks, generated-data checks, and focused mapping/runtime tests pass. Exact-head CI remains the merge gate.

[Reviewed by Robohands]

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic verdict: approve

Theme builders now get one canonical target vocabulary without losing the generic compatibility mechanisms needed for future staged aliases.

  • All 21 retired keys have exact replacements shared by discovery, the codemod, diagnostics, and documentation; collisions preserve both declarations with an actionable TODO.
  • Maintained published themes and bundled templates use canonical keys only, and build validation covers root, light/dark, and ordered adaptation rules.
  • legacyNames, ThemePropsOptions, deprecatedFor, and InputClearButton.iconClassName remain available. The docsite labels staged aliases but excludes them from copyable examples.

Independent exact-head semantic review found no blocking issue. Local full repository and docsite builds, typechecks, generated-data checks, and focused mapping/runtime tests pass. Exact-head CI remains the merge gate.

[Reviewed by Robohands]

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic verdict: approve

Theme builders now get one canonical target vocabulary without losing the generic compatibility mechanisms needed for future staged aliases.

  • All 21 retired keys have exact replacements shared by discovery, the codemod, diagnostics, and documentation; collisions preserve both declarations with an actionable TODO.
  • Maintained published themes and bundled templates use canonical keys only, and build validation covers root, light/dark, and ordered adaptation rules.
  • legacyNames, ThemePropsOptions, deprecatedFor, and InputClearButton.iconClassName remain available. The docsite labels staged aliases but excludes them from copyable examples.

Independent exact-head semantic review found no blocking issue. Local full repository and docsite builds, typechecks, generated-data checks, and focused mapping/runtime tests pass. Exact-head CI remains the merge gate.

[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Sep 9, 2026
@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from f07b59d to cf69b13 Compare September 9, 2026 15:13
@cixzhang cixzhang changed the title fix(theme): remove deprecated target aliases fix(theme): preserve deprecated target compatibility Sep 9, 2026
github-actions Bot added a commit that referenced this pull request Sep 9, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantic verdict: request changes

themeTargets() exposes inconsistent object shapes: parent/child canonicalization creates an own deprecatedFor: undefined property on five current targets, while JSON serialization removes it. Programmatic and JSON consumers therefore receive different projections of the stable schema.

Please assign deprecatedFor only when the child supplies a string, then add a direct-API regression asserting current rows do not own the field while deprecated rows carry their exact replacement. The compatibility-preserving aliases, Popover guidance, canonical first-party examples, changeset, RTL/a11y applicability, and exact-head CI otherwise look good.

[Reviewed by Robohands]

@cixzhang
cixzhang force-pushed the fix/remove-deprecated-theme-targets branch from cf69b13 to 050a571 Compare September 9, 2026 15:48
@astracat-bot

astracat-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Sep 11, 2026, 2:46 AM UTC

# Conflicts:
#	apps/storybook/rtl-audit/verified-not-applicable.json
# Conflicts:
#	docs/architecture/component-theming-surface.md

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme builders using released bare prop or state selectors such as .primary, .sm, and .checked remain broken at this head: themeProps() still omits those classes, and its test requires that omission. Those selectors shipped in 0.5.4, while the current compatibility contract keeps them supported until 0.7.0.

Please restore same-element emission of the released bare value/state classes, including numeric level-* values, and add regression coverage from the 0.5.4 output. The 21 target-name aliases, exact replacement discovery, and build warnings otherwise check out.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this now preserves released selector compatibility through 0.7.0 while keeping canonical data attributes, target aliases, and exact migration warnings intact. The prior blocker is fixed.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 8ffba7b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant