Skip to content

Docs: Document the stages of replacing a legacy component - #85764

Merged
mirka merged 6 commits into
trunkfrom
docs-legacy-component-replacement
Oct 29, 2026
Merged

mirka merged 6 commits into
trunkfrom
docs-legacy-component-replacement

Conversation

@mirka

@mirka mirka commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What?

Follow-up to #85519 (comment)

Document the stages of replacing a @wordpress/components component with one from @wordpress/ui, with the condition for starting each stage, the changes that belong together, and what a reviewer should check.

This is just the docs side of things. Separately, I'm working on some automated checks to prevent drift, in addition to cleaning up the places that have already drifted.

Why?

The individual steps were spread out across the components contributing guide, the @wordpress/ui component status guidance, and the use-recommended-components docs, but the order was not written down. As a result, past replacements took different paths. For example, WC* aliases were added anywhere from before the recommendation to six months after it, and some components are marked as not recommended in Storybook without a denylist entry. A written sequence gives reviewers something to check against, and can be followed by agents implementing or reviewing these changes.

How?

Add a "Replace a legacy component" section to the Design System packages guide with five stages:

  1. Add the WC* alias whenever a public @wordpress/ui export has the same name as a @wordpress/components export, independent of the new component's status.
  2. Migrate a handful of representative Gutenberg consumers before recommending the new component, to find API gaps and flesh out the migration guide.
  3. Recommend the new component in one PR that updates both Storybook statuses, the manifest tags, the allowlist and denylist, the migration guide, and the suppressions baseline. A not-recommended status and a denylist entry always change together.
  4. Migrate the remaining consumers only when there is a reason to, such as already changing the file, a tangible benefit, or an upcoming deprecation, and prune the suppressions.
  5. Decide per component whether to deprecate, and if so, add the runtime warning only after Gutenberg no longer imports the component directly.

Link the section from the @wordpress/components and @wordpress/ui contributing guides and from the design-system-contribution, design-system-code-review, design-system-ui-composition, and design-system-ui-review skills.

Testing Instructions

  1. Read the new Replace a legacy component section and confirm the stages match how we want to work.
  2. Follow the new links from packages/components/CONTRIBUTING.md, packages/ui/CONTRIBUTING.md, and the two skills, and confirm that they land on the section.

Write down the order of the WC alias, trial migrations, recommendation,
remaining migrations, and the optional deprecation when a @wordpress/ui
component replaces a @wordpress/components component, with reviewer
checks for each stage. Link it from the package contributing guides and
the Design System skills.
@mirka mirka added the [Type] Developer Documentation Documentation for developers label Oct 27, 2026
@mirka mirka self-assigned this Oct 27, 2026
@github-actions github-actions Bot added [Package] Components /packages/components [Package] UI /packages/ui labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@mirka
mirka marked this pull request as ready for review October 28, 2026 13:42
@mirka
mirka requested review from a team, fabiankaegy and juanmaguitar as code owners October 28, 2026 13:42

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great 👍 Very exhaustive. With the skill improvements I'm also keen to test it out in AI review 🙂

@mirka
mirka enabled auto-merge (squash) October 29, 2026 08:13
@mirka
mirka merged commit f6e580b into trunk Oct 29, 2026
58 checks passed
@mirka
mirka deleted the docs-legacy-component-replacement branch October 29, 2026 08:22
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Package] UI /packages/ui [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants