Summary
Add a codemod that replaces simple MUI Chip usage with BUI Tag, and recognizes obvious static chip groups that can become TagGroup.
This codemod should stay conservative: display-only chips are in scope, while interactive or avatar chips should be left for manual follow-up.
Detection Criteria
Chip imports from @material-ui/core/Chip
- plain
label-driven chips without onDelete, clickable, or avatar behavior
- obvious static sibling groups of those chips under a common parent
Transformation Logic
- Replace the MUI
Chip import with Tag from @backstage/ui.
- Move the
label prop value into the Tag children.
- Preserve obvious
size="small" mappings when the destination API supports the same size.
- When a local sequence of plain display chips is trivially groupable, wrap them in
TagGroup.
- Insert
TODO(backstage-codemod): verify interactive chip migration manually for chips using delete handlers, clickability, avatars, or custom icons.
Before / After Example
Single display chip:
// Before
import Chip from '@material-ui/core/Chip';
<Chip label="Category" size="small" />
// After
import { Tag } from '@backstage/ui';
<Tag size="small">Category</Tag>
Static chip group:
// Before
<>
<Chip label="A" />
<Chip label="B" />
</>
// After
<TagGroup>
<Tag>A</Tag>
<Tag>B</Tag>
</TagGroup>
Notes / Edge Cases
- Do not guess how clickable or deletable chips should map to the BUI component set.
- If chips are used as dense counters or badges, confirm that
Tag is still the right destination; otherwise leave a TODO marker.
- Representative evidence comes from the notifications plugin migration and the migration skill itself.
- This issue should remain independent from icon migration even if a chip includes a leading icon.
Changeset (when implementing)
- Package:
@backstage/migrate-mui-chip-to-tag
- Bump: minor (initial release)
- Summary example:
Add codemod to migrate mui chip to tag for the Backstage MUI 4 to BUI migration
Implementation notes
- Target directory:
codemods/misc/migrate-mui-chip-to-tag/
- Branch/worktree:
.worktrees/feat/mui4-to-bui/migrate-mui-chip-to-tag
- Open PR when ready; one PR per codemod
Summary
Add a codemod that replaces simple MUI
Chipusage with BUITag, and recognizes obvious static chip groups that can becomeTagGroup.This codemod should stay conservative: display-only chips are in scope, while interactive or avatar chips should be left for manual follow-up.
Detection Criteria
Chipimports from@material-ui/core/Chiplabel-driven chips withoutonDelete,clickable, oravatarbehaviorTransformation Logic
Chipimport withTagfrom@backstage/ui.labelprop value into theTagchildren.size="small"mappings when the destination API supports the same size.TagGroup.TODO(backstage-codemod): verify interactive chip migration manuallyfor chips using delete handlers, clickability, avatars, or custom icons.Before / After Example
Single display chip:
Static chip group:
Notes / Edge Cases
Tagis still the right destination; otherwise leave a TODO marker.Changeset (when implementing)
@backstage/migrate-mui-chip-to-tagAdd codemod to migrate mui chip to tag for the Backstage MUI 4 to BUI migrationImplementation notes
codemods/misc/migrate-mui-chip-to-tag/.worktrees/feat/mui4-to-bui/migrate-mui-chip-to-tag