Repository navigation
feat(codemods): add heading rename codemods, fix SideNav doc - #530
Merged
Merged
Conversation
Add codemods for the heading rename from PR #527: 1. rename-topnav-title-to-heading: Renames title → heading prop on XDSTopNav/XDSTopNavTitle/XDSTopNavHeading, renames XDSTopNavTitle component and imports to XDSTopNavHeading. 2. rename-sidenav-header-to-heading: Renames all props (title → heading, titleHref → headingHref, supertitle → superheading, etc.) on XDSSideNavHeader/XDSSideNavHeading, renames the component and imports. Both codemods handle: - Prop renames on target components only (no false positives) - JSX element name renames (opening + closing tags) - Import specifier renames (including Props types) - Aliased imports (renames imported name, preserves alias) - Returns undefined when no changes needed Also fixes SideNav.doc.mjs: XDSSideNavSection examples incorrectly used heading= prop instead of title= (over-renamed in PR #527).
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsSideNav · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. XDSSideNav - 1 issue(s)
Component PreviewsIncludes interactive hover previews as animated GIFs. XDSSideNavDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
pushed a commit
that referenced
this pull request
Mar 8, 2026
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
added a commit
that referenced
this pull request
Mar 8, 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
Apr 26, 2026
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
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds codemods for the heading rename from PR #527 and fixes an over-rename in the SideNav doc.
Codemods
rename-topnav-title-to-headingtitleprop toheadingon<XDSTopNav>,<XDSTopNavTitle>, and<XDSTopNavHeading><XDSTopNavTitle>to<XDSTopNavHeading>(JSX element name, opening + closing)XDSTopNavTitle→XDSTopNavHeadingandXDSTopNavTitleProps→XDSTopNavHeadingPropsin import specifiersrename-sidenav-header-to-headingtitle→heading,titleHref→headingHref,supertitle→superheading,supertitleHref→superheadingHref,subtitle→subheading,subtitleHref→subheadingHrefon<XDSSideNavHeader>and<XDSSideNavHeading><XDSSideNavHeader>to<XDSSideNavHeading>(JSX element name)XDSSideNavHeader→XDSSideNavHeadingandXDSSideNavHeaderProps→XDSSideNavHeadingPropsin import specifiersBoth codemods:
undefinedwhen no changes neededDoc fix
Fixed
SideNav.doc.mjs:XDSSideNavSectionexamples incorrectly usedheading="..."prop instead oftitle="...". TheXDSSideNavSectioncomponent'stitleprop was not part of the heading rename — it was over-renamed in PR #527.Tests
26 tests across 2 test files covering: