Skip to main content

Migrations and retirements

When your design system replaces or removes a component, record it once on the governance page and the dashboard follows it across every repo. For example, record that LegacyButton from @acme/ui-legacy is replaced by Button from @acme/ui. Every use of LegacyButton is then marked deprecated, and a chart shows repos moving to Button scan by scan.

What you add is a lifecycle record. A Replaced record tracks a migration; a Retired one tracks a retirement, for a component that goes with no replacement.

Record a migration​

  1. Select governance in the top navigation and press Add record.

  2. Under Package or component, the dialog lists your scanned packages, the most used first. Type a few words, such as legacy button, to list the components that match under their packages. Every word must match the package name or the component name.

  3. Pick what the record covers:

    • LegacyButton under @acme/ui-legacy, for that component, or
    • @acme/ui-legacy itself, for every component in it.

    To see a package's components without typing, press its component count, such as 12 components. To pick something else, press Change.

  4. Under What should teams do instead?, leave Move to a replacement chosen.

  5. In Replacement, type button and pick Button under @acme/ui. To make the whole of @acme/ui the replacement, pick @acme/ui itself.

  6. Press Create record. The dialog stays open with an empty form for the next record, and the line at its foot counts the records you've added: press Show to list them. Press Done when you've finished.

The New record dialog, filled in to record VxeButton from vxe-pc-ui as replaced by Button from tdesign-vue-next

The lists only offer packages and components that appear in uploaded scans. If LegacyButton is missing, upload a scan of a repo that uses it first.

If @acme/ui-legacy is written in the same monorepo as the apps that use it, the lists offer it too, like any installed package.

A component defined in the repo outside every workspace package is offered under the repo's root package: the name in the root package.json, or the repo id when it has none. In a repo that isn't a monorepo, that's every component the repo defines. Scans uploaded by older CLI versions record no package for these components, so if one is missing, scan the repo with the latest CLI. If the dashboard already has a scan of the commit you're on, run npx scout scan --rescan to replace it.

A web component such as <acme-button> is offered under a package only when a scan links the tag to that package, and a record covers it only in the scans that make that link. Link web components to your package shows how.

Each package or component can have one record, and a package has either one whole-package record or records on single components, not both. A package or component that can't take a record stays in the list, greyed out, with the reason, such as Already recorded. If saving is refused, a message in the dialog says why, and for an existing record usually offers Go to the existing record so you can edit that one instead.

Record a retirement​

Retire a component when it is being removed with no replacement, for example Modal from @acme/ui-legacy.

  1. On the governance page, press Add record.
  2. In Package or component, pick Modal under @acme/ui-legacy, or @acme/ui-legacy itself for the whole package.
  3. Under What should teams do instead?, choose Retire it.
  4. In Reason, say why it is going, for example Removed in @acme/ui-legacy 4.0; no replacement.
  5. Press Create record.

What changes, and when​

As soon as you save, every component the record covers shows as deprecated in every repo: warning icons, deprecated chips and the Deprecated columns. That includes scans already uploaded, so no rescan is needed. A record on Card covers it from every import path, such as @acme/ui and @acme/ui/card, and its parts, such as Card.Header.

The governance page then shows how much of each record's package or component is still in use, and where. Records are listed by package. Press the arrow beside a package's name to see its records.

Each record's Uses left reads one of these:

  • A count of uses across every repo's latest scan, such as 17 in acme/storefront, or 20 in 2 repos when several repos use it. With only one repo scanned, it's just the number.
  • None left: it has been used before, and no repo's latest scan uses it now.
  • Not in any scan: see Not in any scan.
  • No data: it hasn't been counted yet, usually because you've just added or changed the record. Reload the page after a moment to see its count.

The governance page listing records by package, each with its replacement or reason and its uses left

Follow progress​

On the governance page, select a record's count to open its chart: uses over time of LegacyButton and Button, added up across the repos that have used LegacyButton. Each side counts its component from every import path, together with its parts. Until one of those repos uses Button, the Button line stays at 0. A retirement's chart shows the retired component alone.

To see where a record's component or package is still used, select the record's name.

The same charts are on the charts page, under Migrations and retirements, grouped by the package each record moves away from. Select @acme/ui-legacy to see its rows: a migration reads how much is Migrated and its Uses left, and a retirement its Uses left, the uses still in the code. Each row also shows how the uses left changed over the last 30 days. Records that name the same replacement, such as one for each part of a compound component, share one row and one chart. That chart draws each old component as its own line beside the replacement's, and the table under it lists each line's uses and how much they changed over the period you picked. See Charts.

To follow one repo, open it from repos and go to its Adoption tab. Migrations and retirements in this repo counts that repo alone, so its numbers can differ from the charts page, and a migration or retirement opens its chart for that repo. A repo that never used LegacyButton has no row for it. See Follow adoption in a repo.

How a migration's progress is counted explains the percentage.

When a record reads None left​

No button marks a record complete. It reads None left once no repo's latest scan uses LegacyButton, so finishing a migration means:

  1. Remove the last uses of LegacyButton from each repo. To find them, open LegacyButton from its package page and see Find where a component is used.
  2. Scan each of those repos and upload the scan. Every repo counts with its latest scan, however old, so a repo not scanned since it last used LegacyButton still counts its old uses. Run in CI keeps scans coming.

Once every record in a package reads None left, the governance page moves them behind Show N complete. On the charts page, each complete record moves to Complete. If a later scan uses LegacyButton again, the record counts it again. Keep the record once it is complete: it still marks any new use as deprecated.

Not in any scan​

A record reads Not in any scan, and has no chart, when none of the scans in the dashboard contain the package or component it names. The lists only offer what scans contain, so this happens when the scans that used it have since been removed from the dashboard. Upload a scan of a repo that still uses it and the count comes back, with no edit needed. If no repo uses it any more, it keeps reading Not in any scan, and the record still marks any new use as deprecated.

Edit or delete a record​

To change a record, press its Edit button, make your changes and press Save.

To delete a record, press Delete in the same dialog, then Delete again to confirm.

warning

Deleting a record removes its deprecated mark straight away, so a new use of LegacyButton shows as an ordinary component. Its chart and its rows on the charts page and on each repo's Adoption tab go too, once the dashboard has recalculated.

Next step​

To compare whole libraries rather than one component, such as @acme/ui against @acme/ui-legacy, tag your libraries and chart them. See Charts.