Deprecate Button from @automattic/jetpack-components in favor of @wordpress/ui Button
I maintainer di solito rispondono entro 1 giorno
@CGastrell ci sta già lavorando.
Dal 13/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Deprecate Button from @automattic/jetpack-components in favor of @wordpress/ui Button
Background
The Button component exported from @automattic/jetpack-components duplicates functionality now covered by the WordPress Design System's Button in @wordpress/ui (the new themeable UI package in Gutenberg, currently at v0.10.0). To reduce our custom-component surface and align with the WordPress Design System, we want to migrate all usages and eventually remove the jetpack-components version.
This issue captures an audit of current usage and proposes a phased migration plan.
Note: An earlier draft of this issue mentioned
@wordpress/components. The correct target is@wordpress/ui, which is a distinct package with a different API surface. The plan below has been rewritten accordingly.
@wordpress/ui exports relevant to this migration
From gutenberg/packages/ui/src/index.ts, the relevant exports are:
Button— the general-purpose button. Noiconprop, nohrefprop.IconButton—Omit<ButtonProps, 'children'> & { label, icon, shortcut? }. Used for icon-only buttons; provides built-in tooltip + a11y labeling.Link— separate component for anchor-style navigation.
@wordpress/ui Button API (v0.10.0)
interface ButtonProps {
variant?: 'solid' | 'outline' | 'minimal' | 'unstyled'; // default: 'solid'
tone?: 'brand' | 'neutral'; // default: 'brand'
size?: 'default' | 'compact' | 'small'; // default: 'default'
disabled?: boolean;
focusableWhenDisabled?: boolean; // default: true
'aria-pressed'?: …; // for toggle buttons
loading?: boolean; // built-in loading support
loadingAnnouncement?: string; // a11y announcement
children?: ReactNode;
}
Built on top of @base-ui/react/button. The component auto-disables while loading is true and announces loading state via speak().
Audit Summary
- Total sites using the jetpack-components Button: ~90 imports across ~70 files in 11 packages/plugins
- Main
projects/plugins/jetpackclient code: not affected — it usesActionButton, which is out of scope.
Usage by package
| Package / Plugin | Button usages | CSS overrides |
|---|---|---|
projects/plugins/boost |
18 | 2 |
projects/plugins/protect |
14 | 0 |
projects/packages/videopress |
13 | 1 |
projects/packages/publicize |
13 | 3 |
projects/packages/my-jetpack |
8 | 0 |
projects/js-packages/scan |
6 | 0 |
projects/plugins/crm |
2 | 0 |
projects/plugins/automattic-for-agencies-client |
2 | 0 |
projects/js-packages/licensing |
1 | 1 |
projects/js-packages/connection |
1 | 0 |
projects/js-packages/components |
1 | 0 |
API gap analysis — @automattic/jetpack-components ➜ @wordpress/ui
This is a more substantial rewrite than a drop-in rename. The variant vocabulary, the icon story, and the link story are all different.
Variant/tone mapping (provisional — needs design review)
| Jetpack prop | @wordpress/ui equivalent |
Notes |
|---|---|---|
variant="primary" |
variant="solid" + tone="brand" (default) |
Both are defaults — no attribute needed. |
variant="secondary" |
variant="outline" (likely) |
Design confirmation required. |
variant="tertiary" |
variant="minimal" (likely) |
Design confirmation required. |
variant="link" |
Link component |
Not a Button variant — use the Link export. |
isDestructive |
❌ no direct equivalent | tone only offers brand/neutral. Needs design guidance or a CSS utility. |
isLoading |
loading |
Better than jetpack — built-in spinner + a11y announcement. loadingAnnouncement replaces the text prop. |
text (loading description) |
loadingAnnouncement |
1:1 replacement when used with loading. |
weight="bold" / weight="regular" |
❌ no equivalent | Add a CSS utility or drop the distinction. |
size="normal" |
size="default" |
Rename. |
size="small" |
size="small" |
Unchanged. |
disabled |
disabled |
Unchanged. |
className, children, onClick |
same | Unchanged. |
icon / iconSize |
IconButton component |
Separate import. Requires a label prop (a11y). |
href |
Link component |
Button doesn't accept href. Requires either switching to Link or using base-ui's render prop. |
isExternalLink |
❌ no equivalent | Link may or may not support it — needs confirmation. |
fullWidth |
❌ no equivalent | CSS-only. |
Component choice flowchart for each call site
- Used purely as a link (
href, noonClick) → migrate toLink. - Icon-only / icon-with-tooltip → migrate to
IconButton. - Button with text + icon next to it → either
<Button>{icon}{text}</Button>manually, or evaluateIconButtonif the icon is the meaning. - Button with
isDestructive→ flag for design, pending decision. - All other buttons →
Buttonwith mappedvariant/tone/size.
Migration plan
Phase 0 — Prerequisites
Before any bulk migration, we should:
- Design sign-off on the variant/tone mapping — particularly for
secondary,tertiary, andisDestructive. Missing destructive styling is the biggest open question. - Decide on
weighthandling — either add a.is-boldutility class or drop the distinction in coordination with design. - Confirm
@wordpress/uiis acceptable as a runtime dependency for every affected package (dependency graph, bundle size, build config). - Document the migration guide in a short README inside the jetpack-components package (or a Make post) covering the flowchart above.
Phase 1 — True straight swaps
Files using only default props (no icon, no href, no isDestructive, no variant, no weight, no isLoading). These reduce to an import rename plus possibly size="normal" → size="default".
Candidates from the audit (to be re-verified call-by-call during migration):
projects/plugins/automattic-for-agencies-client/components/connected-card/index.jsxprojects/plugins/boost/.../features/ui/collapsible-meta/collapsible-meta.tsxprojects/plugins/boost/.../features/speed-score/speed-score.tsxprojects/plugins/boost/.../features/performance-history/performance-history.tsxprojects/plugins/boost/.../features/critical-css/folding-element/folding-element.tsxprojects/plugins/boost/.../pages/purchase-success/purchase-success.tsxprojects/plugins/boost/.../pages/critical-css-advanced/critical-css-advanced.tsxprojects/plugins/crm/.../automations-admin/.../edit-modal/index.tsxprojects/packages/publicize/.../form/broken-connections-notice.tsxprojects/packages/publicize/.../connection-management/index.tsxprojects/packages/publicize/.../connection-management/disconnect.tsxprojects/packages/publicize/.../connection-management/reconnect.tsxprojects/packages/publicize/.../admin-page/header/index.jsprojects/packages/publicize/.../services/connect-form.tsxprojects/packages/my-jetpack/.../golden-token/tooltip/index.tsxprojects/packages/videopress/.../components/chapters-learn-more-helper/index.tsxprojects/packages/videopress/.../components/incomplete-chapters-notice/index.tsx
Phase 2 — href-only call sites (migrate to Link)
Files where the Button is used as navigation (has href, no significant handler state). These need to be re-evaluated: should it render as a Link styled as a button, or just a Link?
projects/plugins/automattic-for-agencies-client/components/disconnect-site-link/index.jsxprojects/plugins/boost/.../features/ui/back-button/back-button.tsxprojects/plugins/boost/.../features/speed-score/pop-out/pop-out.tsxprojects/plugins/boost/.../features/page-cache/switch-to-boost/switch-to-boost.tsxprojects/plugins/boost/.../features/cornerstone-pages/meta/meta.tsxprojects/plugins/boost/.../features/lcp/lcp.tsxprojects/plugins/boost/.../features/minify-legacy-notice/minify-legacy-notice.tsxprojects/plugins/boost/.../layout/settings-page/support/support.tsxprojects/js-packages/connection/components/manage-connection-dialog/index.jsxprojects/plugins/protect/src/js/routes/scan/onboarding-steps.jsxprojects/plugins/protect/src/js/routes/firewall/firewall-upgrade-prompt.jsxprojects/plugins/protect/src/js/routes/firewall/firewall-footer.jsxprojects/packages/my-jetpack/.../product-interstitial-modal/product-interstitial-my-jetpack.tsx
Phase 3 — Icon buttons (migrate to IconButton)
Files whose Button primarily conveys meaning via an icon. Each needs a label for accessibility.
projects/packages/videopress/.../admin/components/pagination/index.tsxprojects/packages/videopress/.../admin/components/video-quick-actions/index.tsxprojects/packages/videopress/.../admin/components/video-filter/index.tsxprojects/packages/videopress/.../admin/components/clipboard-button-input/index.tsxprojects/plugins/crm/src/js/components/automations-admin/components/workflow-row/index.tsxprojects/packages/publicize/.../connection-management/connection-info.tsx
Phase 4 — Files requiring per-site review (deferred pending Phase 0 decisions)
Flagged because they depend on props or behavior that is not yet resolved (isDestructive, weight, isExternalLink, fullWidth), have CSS overrides targeting the jetpack-components button, or wrap the button in additional logic.
Depends on missing/unresolved props
projects/js-packages/scan/src/components/threat-fixer-button/index.tsx—isLoading(OK),isDestructive,weight,size="small", icon, Tooltip wrapperprojects/plugins/boost/.../features/critical-css/status/status.tsx— dynamicvariant,size="small",weight="regular", icon, disabled- Any call site using
isExternalLinkorfullWidth(to be enumerated during migration)
CSS overrides targeting the button
projects/plugins/boost/.../features/minify-meta/minify-meta.module.scss— marginprojects/plugins/boost/.../features/page-cache/meta/meta.module.scss— scoped spacingprojects/packages/publicize/.../admin-page/toggles/social-image-generator-toggle/styles.module.scss— grid + marginprojects/packages/publicize/.../admin-page/toggles/social-notes-toggle/styles.module.scss— spacingprojects/packages/videopress/.../admin/components/pagination/style.module.scss— width + disabled stateprojects/js-packages/licensing/components/golden-token-modal/styles.module.scss— modal button layout
Wrappers / complex components
projects/packages/my-jetpack/_inc/components/action-button/index.tsx— ~450 lines, dynamic variant logic across 15+ product statuses. Candidate for a dedicated follow-up PR.projects/plugins/protect/src/js/components/button-group/index.jsx— wraps Button asButtonGroup.Buttonwith default variant.projects/js-packages/components/components/upsell-banner/index.tsx— Button embedded in a reusable component consumed elsewhere; swap affects all consumers.
Composed usage to verify visually
Files using ThemeProvider, useBreakpointMatch, Text, IconTooltip, or getRedirectUrl alongside the button. Mechanically safe but need visual verification as a group:
projects/plugins/protect/src/js/components/—ignore-threat-modal,unignore-threat-modal,fix-threat-modal,fix-all-threats-modal,user-connection-needed-modal,scan-button,navigation/group,threats-list/pagination,threats-list/free-listprojects/js-packages/scan/.../threat-modal/—threat-actions,threat-summary,threat-notice,threat-technical-detailsprojects/packages/videopress/.../admin/components/—video-thumbnail-selector-modal,admin-page/libraries,delete-video-confirmation-modal,video-upload-areaprojects/packages/publicize/.../admin-page/toggles/social-image-generator-toggle,.../admin-page/toggles/social-notes-toggle,.../share-buttons/share-buttons,.../media-picker,.../services/service-itemprojects/packages/my-jetpack/.../action-button/secondary-button,.../plans-section,.../product-interstitial-modal/*(2 files),.../product-card/recommendation-actionsprojects/js-packages/licensing/components/golden-token-modal/index.jsx
Out of scope
ActionButtonfrom@automattic/jetpack-components— separate component, not part of this deprecation.- Removal of the
Buttonexport from@automattic/jetpack-components— follow-up after all call sites are migrated.
Acceptance criteria
- Phase 0 prerequisites resolved (design mapping, missing-prop decisions, dependency acceptance, migration guide)
- Phase 1 straight swaps merged (one PR per package is reasonable)
- Phase 2
href-only sites migrated toLink - Phase 3 icon-only sites migrated to
IconButton - Phase 4 deferred files either migrated or documented if intentionally left behind
-
Buttonremoved from@automattic/jetpack-componentsexports - Changelog entries added per affected package
Audit performed against the current state of trunk on 2026-04-17. @wordpress/ui API reviewed against gutenberg/packages/ui at v0.10.0.
- Lingua principale
- PHP
- Stelle
- 1.9k
- Fork
- 913
- Merge medio
- 1g 18h
- PR unite (30g)
- 809
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/jetpack
-
Bug Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Automattic/jetpack#55870 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/jetpack#55385 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WAF: jetpack_waf_blocklog is created without the site's charset and collationForse già presa @jwebbdev l’ha presa 3 giorni fa. Aperta[Plugin] Protect Bug Customer Report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Automattic/jetpack#55365 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Package] Stats Admin [Type] Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
Automattic/jetpack#54188 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Automattic/jetpack#53467 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/jetpack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
SVG path arcs with an explicit zero radius throw DivisionByZeroErrorForse già presa @Syed-Shehroz-Sohail l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Перевод устарел
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno