Skip to content

feat!: remove deprecated APIs and add icon migration codemod for v0.0.2 - #533

Merged
cixzhang merged 1 commit into
mainfrom
navi/feat/remove-deprecated-v0.0.2
Mar 8, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/feat/remove-deprecated-v0.0.2

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes deprecated exports that were introduced in prior PRs and adds the missing codemod for icon migration. This is a breaking change for v0.0.2.

Removed APIs

Heading renames (from PR #527, codemods in #530)

  • XDSTopNavTitle → use XDSTopNavHeading
  • XDSTopNavTitleProps → use XDSTopNavHeadingProps
  • XDSSideNavHeader → use XDSSideNavHeading
  • XDSSideNavHeaderProps → use XDSSideNavHeadingProps

Icon hook deprecation (from PR #531)

  • useXDSIcon hook → use getIcon from globalIconRegistry
  • IconRegistryContext → use registerIcons() + getIcon()
  • IconRegistry.tsx file deleted entirely
  • getGlobalRegistry internal helper removed (was only used by useXDSIcon)

Added

Codemod: migrate-useXDSIcon-to-getIcon

Handles the full migration from the deprecated context-based icon system to the global registry:

  • Renames useXDSIcon(...) calls to getIcon(...)
  • Updates import specifiers: useXDSIcon → getIcon
  • Updates import source from IconRegistry to globalIconRegistry (internal imports)
  • Removes IconRegistryContext from imports
  • Removes IconRegistryContext.Provider JSX wrappers

11 tests covering all transform cases.

Internal import updates

  • defaultIcons.tsx: imports XDSIconRegistry from globalIconRegistry instead of deleted IconRegistry
  • defineTheme.ts: same import path update

Verification

  • ✅ yarn build passes
  • ✅ yarn test passes (87 files, 1401 tests)
  • ✅ yarn lint passes (0 errors, 8 pre-existing warnings)
  • ✅ No remaining references to removed APIs outside codemods/tests

Migration

Run the v0.0.2 codemods:

npx xds codemod --version 0.0.2

BREAKING CHANGE: Remove deprecated exports that were replaced in prior PRs.

Removed:
- XDSTopNavTitle, XDSTopNavTitleProps (use XDSTopNavHeading, XDSTopNavHeadingProps)
- XDSSideNavHeader, XDSSideNavHeaderProps (use XDSSideNavHeading, XDSSideNavHeadingProps)
- useXDSIcon hook (use getIcon from globalIconRegistry)
- IconRegistryContext (use registerIcons + getIcon)
- IconRegistry.tsx (deleted — all functionality lives in globalIconRegistry.tsx)
- getGlobalRegistry internal helper (no longer needed)

Added:
- migrate-useXDSIcon-to-getIcon codemod with 11 tests
- Updates internal imports from IconRegistry to globalIconRegistry

Migration codemods exist for all removed APIs:
- rename-topnav-title-to-heading (PR #530)
- rename-sidenav-header-to-heading (PR #530)
- migrate-useXDSIcon-to-getIcon (this PR)

Refs: #527, #530, #531
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 8, 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.

Self-review ✅

Removals verified:

  • XDSTopNavTitle / XDSTopNavTitleProps re-exports removed from TopNav/index.ts
  • XDSSideNavHeader / XDSSideNavHeaderProps re-exports removed from SideNav/index.ts
  • IconRegistry.tsx deleted entirely (useXDSIcon, IconRegistryContext, getGlobalRegistry all gone)
  • Deprecated exports removed from Icon/index.ts

Import updates verified:

  • defaultIcons.tsx: XDSIconRegistry import updated to globalIconRegistry
  • defineTheme.ts: XDSIconRegistry import updated to globalIconRegistry
  • XDSTheme.tsx: Already clean (no IconRegistryContext import)

New codemod verified:

  • migrate-useXDSIcon-to-getIcon.mjs: Handles all 6 transform cases
  • Registered in index.mjs manifest
  • 11 tests all passing

CI checks:

  • yarn build ✅
  • yarn test ✅ (87 files, 1401 tests)
  • yarn lint ✅ (0 errors)
  • No stale references to removed APIs outside codemods/tests ✅

@github-actions

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

Icon · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 293B N/A
Lines of Code N/A 299 -
Complexity N/A Low (4) -
SideNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 647B N/A
Lines of Code N/A 847 -
Complexity N/A Very High (70) -
TopNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 515B N/A
Lines of Code N/A 977 -
Complexity N/A Very High (50) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 9.1KB 14.7KB 2.3KB

Accessibility Audit

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

XDSIcon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSSideNav - 1 issue(s)
  • 🟠 serious: Ensure links have discernible text
    • Rule: link-name · Affects 1/8 stories · Learn more
    • WCAG: 2.4.4, 4.1.2 (Level A)

Component Previews

Includes interactive hover previews as animated GIFs.

XDSIcon

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

View in Storybook · core-xdsicon--default

Primary

Screenshot:

Primary

View in Storybook · core-xdsicon--primary

Secondary

Screenshot:

Secondary

View in Storybook · core-xdsicon--secondary

Accent

Screenshot:

Accent

View in Storybook · core-xdsicon--accent

Positive

Screenshot:

Positive

View in Storybook · core-xdsicon--positive

Negative

Screenshot:

Negative

View in Storybook · core-xdsicon--negative

Warning

Screenshot:

Warning

View in Storybook · core-xdsicon--warning

Extra Small

Screenshot:

Extra Small

View in Storybook · core-xdsicon--extra-small

Small

Screenshot:

Small

View in Storybook · core-xdsicon--small

Medium

Screenshot:

Medium

View in Storybook · core-xdsicon--medium

Large

Screenshot:

Large

View in Storybook · core-xdsicon--large

Solid Icon

Screenshot:

Solid Icon

View in Storybook · core-xdsicon--solid-icon

All Colors

Screenshot:

All Colors

View in Storybook · core-xdsicon--all-colors

All Sizes

Screenshot:

All Sizes

View in Storybook · core-xdsicon--all-sizes

Outline Vs Solid

Screenshot:

Outline Vs Solid

View in Storybook · core-xdsicon--outline-vs-solid

Inherit Color

Screenshot:

Inherit Color

View in Storybook · core-xdsicon--inherit-color

XDSSideNav

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

View in Storybook · navigation-xdssidenav--default

Title Without Icon

Screenshot:

Title Without Icon

View in Storybook · navigation-xdssidenav--title-without-icon

Header with Menu

Screenshot:

Header with Menu

View in Storybook · navigation-xdssidenav--with-header-menu

Suite with Independent Links

Screenshot:

Suite with Independent Links

View in Storybook · navigation-xdssidenav--suite-header

Nested Items

Screenshot:

Nested Items

View in Storybook · navigation-xdssidenav--nested-items

With Footer Icons

Screenshot:

With Footer Icons

View in Storybook · navigation-xdssidenav--with-footer

Disabled Items

Screenshot:

Disabled Items

View in Storybook · navigation-xdssidenav--disabled-item

Hidden Section Header

Screenshot:

Hidden Section Header

View in Storybook · navigation-xdssidenav--hidden-section-header

XDSTopNav

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

View in Storybook · navigation-xdstopnav--default

With Logo

Screenshot:

With Logo

View in Storybook · navigation-xdstopnav--with-logo

Title Only

Screenshot:

Title Only

View in Storybook · navigation-xdstopnav--title-only

Nav Item States

Screenshot:

Nav Item States

View in Storybook · navigation-xdstopnav--nav-item-states

Centered Navigation

Screenshot:

Centered Navigation

View in Storybook · navigation-xdstopnav--centered-navigation

Centered With Start Content

Screenshot:

Centered With Start Content

View in Storybook · navigation-xdstopnav--centered-with-start-content

Center Content Without End

Screenshot:

Center Content Without End

View in Storybook · navigation-xdstopnav--center-content-without-end

Full Example

Screenshot:

Full Example

View in Storybook · navigation-xdstopnav--full-example


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

@cixzhang
cixzhang merged commit 25aa781 into main Mar 8, 2026
14 checks passed
@cixzhang
cixzhang deleted the navi/feat/remove-deprecated-v0.0.2 branch March 13, 2026 10:50
cixzhang added a commit that referenced this pull request Apr 26, 2026
….2 (#533)

BREAKING CHANGE: Remove deprecated exports that were replaced in prior PRs.

Removed:
- XDSTopNavTitle, XDSTopNavTitleProps (use XDSTopNavHeading, XDSTopNavHeadingProps)
- XDSSideNavHeader, XDSSideNavHeaderProps (use XDSSideNavHeading, XDSSideNavHeadingProps)
- useXDSIcon hook (use getIcon from globalIconRegistry)
- IconRegistryContext (use registerIcons + getIcon)
- IconRegistry.tsx (deleted — all functionality lives in globalIconRegistry.tsx)
- getGlobalRegistry internal helper (no longer needed)

Added:
- migrate-useXDSIcon-to-getIcon codemod with 11 tests
- Updates internal imports from IconRegistry to globalIconRegistry

Migration codemods exist for all removed APIs:
- rename-topnav-title-to-heading (PR #530)
- rename-sidenav-header-to-heading (PR #530)
- migrate-useXDSIcon-to-getIcon (this PR)

Refs: #527, #530, #531

Co-authored-by: navi[bot] <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
….2 (#533)

BREAKING CHANGE: Remove deprecated exports that were replaced in prior PRs.

Removed:
- XDSTopNavTitle, XDSTopNavTitleProps (use XDSTopNavHeading, XDSTopNavHeadingProps)
- XDSSideNavHeader, XDSSideNavHeaderProps (use XDSSideNavHeading, XDSSideNavHeadingProps)
- useXDSIcon hook (use getIcon from globalIconRegistry)
- IconRegistryContext (use registerIcons + getIcon)
- IconRegistry.tsx (deleted — all functionality lives in globalIconRegistry.tsx)
- getGlobalRegistry internal helper (no longer needed)

Added:
- migrate-useXDSIcon-to-getIcon codemod with 11 tests
- Updates internal imports from IconRegistry to globalIconRegistry

Migration codemods exist for all removed APIs:
- rename-topnav-title-to-heading (PR #530)
- rename-sidenav-header-to-heading (PR #530)
- migrate-useXDSIcon-to-getIcon (this PR)

Refs: #527, #530, #531

Co-authored-by: navi[bot] <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
….2 (#533)

BREAKING CHANGE: Remove deprecated exports that were replaced in prior PRs.

Removed:
- XDSTopNavTitle, XDSTopNavTitleProps (use XDSTopNavHeading, XDSTopNavHeadingProps)
- XDSSideNavHeader, XDSSideNavHeaderProps (use XDSSideNavHeading, XDSSideNavHeadingProps)
- useXDSIcon hook (use getIcon from globalIconRegistry)
- IconRegistryContext (use registerIcons + getIcon)
- IconRegistry.tsx (deleted — all functionality lives in globalIconRegistry.tsx)
- getGlobalRegistry internal helper (no longer needed)

Added:
- migrate-useXDSIcon-to-getIcon codemod with 11 tests
- Updates internal imports from IconRegistry to globalIconRegistry

Migration codemods exist for all removed APIs:
- rename-topnav-title-to-heading (PR #530)
- rename-sidenav-header-to-heading (PR #530)
- migrate-useXDSIcon-to-getIcon (this PR)

Refs: #527, #530, #531
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