Repository navigation
feat!: remove deprecated APIs and add icon migration codemod for v0.0.2 - #533
Conversation
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
cixzhang
left a comment
There was a problem hiding this comment.
Self-review ✅
Removals verified:
XDSTopNavTitle/XDSTopNavTitlePropsre-exports removed from TopNav/index.tsXDSSideNavHeader/XDSSideNavHeaderPropsre-exports removed from SideNav/index.tsIconRegistry.tsxdeleted entirely (useXDSIcon, IconRegistryContext, getGlobalRegistry all gone)- Deprecated exports removed from Icon/index.ts
Import updates verified:
defaultIcons.tsx: XDSIconRegistry import updated to globalIconRegistrydefineTheme.ts: XDSIconRegistry import updated to globalIconRegistryXDSTheme.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 ✅
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsIcon · View in Storybook
SideNav · View in Storybook
TopNav · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 2 accessibility violation(s) found — 2 serious. XDSIcon - 1 issue(s)
XDSSideNav - 1 issue(s)
Component PreviewsIncludes interactive hover previews as animated GIFs. XDSIconXDSSideNavDefaultScreenshot: Interaction Preview: (view video) View in Storybook · XDSTopNavDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Centered With Start ContentScreenshot: View in Storybook · Center Content Without EndScreenshot: View in Storybook · Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
….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]>
….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]>
….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
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→ useXDSTopNavHeadingXDSTopNavTitleProps→ useXDSTopNavHeadingPropsXDSSideNavHeader→ useXDSSideNavHeadingXDSSideNavHeaderProps→ useXDSSideNavHeadingPropsIcon hook deprecation (from PR #531)
useXDSIconhook → usegetIconfromglobalIconRegistryIconRegistryContext→ useregisterIcons()+getIcon()IconRegistry.tsxfile deleted entirelygetGlobalRegistryinternal helper removed (was only used byuseXDSIcon)Added
Codemod:
migrate-useXDSIcon-to-getIconHandles the full migration from the deprecated context-based icon system to the global registry:
useXDSIcon(...)calls togetIcon(...)useXDSIcon→getIconIconRegistrytoglobalIconRegistry(internal imports)IconRegistryContextfrom importsIconRegistryContext.ProviderJSX wrappers11 tests covering all transform cases.
Internal import updates
defaultIcons.tsx: importsXDSIconRegistryfromglobalIconRegistryinstead of deletedIconRegistrydefineTheme.ts: same import path updateVerification
yarn buildpassesyarn testpasses (87 files, 1401 tests)yarn lintpasses (0 errors, 8 pre-existing warnings)Migration
Run the v0.0.2 codemods: