Skip to content

feat: radius codemods & skeleton cleanup for v0.0.5 - #690

Merged
cixzhang merged 1 commit into
mainfrom
navi/feat/radius-codemods
Mar 18, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/feat/radius-codemods

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #686 (dynamic radius tokens). Removes deprecated backwards-compat from Skeleton and adds codemods for consumer migration.

Skeleton Cleanup

Removes deprecated semantic radius names from XDSSkeleton:

  • Removed: inner, content, element, container as radius prop values
  • Kept: none, 0, 1, 2, 3, 4, rounded
  • Default changed: "container" → 3

Codemods (v0.0.5)

Two new codemods registered in the v0.0.5 transform manifest:

migrate-radius-tokens

Rewrites CSS custom property references from semantic to numeric:

  • --radius-inner → --radius-0
  • --radius-content → --radius-1
  • --radius-element → --radius-2
  • --radius-container → --radius-3
  • --radius-page → --radius-4

Handles string literals, template literals, radiusVars property access, defineTheme token objects, and var() references.

migrate-skeleton-radius

Rewrites XDSSkeleton radius prop values:

  • radius="container" → radius={3}
  • radius="element" → radius={2}
  • radius="content" → radius={1}
  • radius="inner" → radius={0}

Handles both string attributes (radius="container") and expression containers (radius={"container"}).

Tests

  • 9 tests for migrate-radius-tokens
  • 9 tests for migrate-skeleton-radius
  • All 1655 tests pass

Usage

npx xds upgrade --from 0.0.4 --to 0.0.5 --path ./src
npx xds upgrade --from 0.0.4 --to 0.0.5 --path ./src --apply

- Remove deprecated semantic radius names from XDSSkeleton
  (inner/content/element/container → 0/1/2/3/4)
  Default changes from 'container' to 3

- Add migrate-radius-tokens codemod
  Rewrites --radius-inner/content/element/container/page
  to --radius-0/1/2/3/4 in string literals and template literals

- Add migrate-skeleton-radius codemod
  Rewrites <XDSSkeleton radius="container" /> to radius={3}
  Handles both string attributes and expression containers

Both codemods registered in v0.0.5 transform manifest.
25 test cases across both codemods.

Co-authored-by: Navi <[email protected]>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 18, 2026
@github-actions

github-actions Bot commented Mar 18, 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

Skeleton · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 209B N/A
Lines of Code N/A 106 -
Complexity N/A Low (3) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 10.5KB 16.8KB 2.6KB

Accessibility Audit

Status: No accessibility violations detected.


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

@cixzhang
cixzhang merged commit b0f00f0 into main Mar 18, 2026
11 checks passed
@cixzhang
cixzhang deleted the navi/feat/radius-codemods branch March 18, 2026 20:58
cixzhang added a commit that referenced this pull request Apr 26, 2026
- Remove deprecated semantic radius names from XDSSkeleton
  (inner/content/element/container → 0/1/2/3/4)
  Default changes from 'container' to 3

- Add migrate-radius-tokens codemod
  Rewrites --radius-inner/content/element/container/page
  to --radius-0/1/2/3/4 in string literals and template literals

- Add migrate-skeleton-radius codemod
  Rewrites <XDSSkeleton radius="container" /> to radius={3}
  Handles both string attributes and expression containers

Both codemods registered in v0.0.5 transform manifest.
25 test cases across both codemods.

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
- Remove deprecated semantic radius names from XDSSkeleton
  (inner/content/element/container → 0/1/2/3/4)
  Default changes from 'container' to 3

- Add migrate-radius-tokens codemod
  Rewrites --radius-inner/content/element/container/page
  to --radius-0/1/2/3/4 in string literals and template literals

- Add migrate-skeleton-radius codemod
  Rewrites <XDSSkeleton radius="container" /> to radius={3}
  Handles both string attributes and expression containers

Both codemods registered in v0.0.5 transform manifest.
25 test cases across both codemods.

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
- Remove deprecated semantic radius names from XDSSkeleton
  (inner/content/element/container → 0/1/2/3/4)
  Default changes from 'container' to 3

- Add migrate-radius-tokens codemod
  Rewrites --radius-inner/content/element/container/page
  to --radius-0/1/2/3/4 in string literals and template literals

- Add migrate-skeleton-radius codemod
  Rewrites <XDSSkeleton radius="container" /> to radius={3}
  Handles both string attributes and expression containers

Both codemods registered in v0.0.5 transform manifest.
25 test cases across both codemods.
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant