My Jetpack: migrate overview Button and Text to @wordpress/ui#48166
My Jetpack: migrate overview Button and Text to @wordpress/ui#48166
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
843b226 to
af92d08
Compare
af92d08 to
f6e1037
Compare
Partial of #48160 — My Jetpack dashboard section.
Proposed changes
Per-page migration pass on the My Jetpack overview page (
/wp-admin/admin.php?page=my-jetpack#/overview): swap safeTextandButtonusages from@automattic/jetpack-componentsto@wordpress/uiv0.11.0. Adds@wordpress/uito themy-jetpackpackage dependencies at the version already used by sibling packages (forms, newsletter, publicize, charts, components).Files migrated (9)
Text →
@wordpress/uiText with variant mapping (body→body-md,body-small→body-sm,label→body-sm,title-medium→heading-lg):packages/my-jetpack/_inc/components/connected-product-card/index.tsxpackages/my-jetpack/_inc/components/product-card/status.tsxpackages/my-jetpack/_inc/components/connection-status-card/index.tsxpackages/my-jetpack/_inc/components/card/index.jsxpackages/my-jetpack/_inc/components/plans-section/index.tsx(Text only — Buttons left for follow-up)packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsxpackages/my-jetpack/_inc/components/product-cards-section/videopress-card/index.tsxpackages/my-jetpack/_inc/components/product-cards-section/contextual-card-info.jsxButton →
@wordpress/uiButton (variant="secondary"→"outline"):packages/my-jetpack/_inc/components/product-card/recommendation-actions.tsxOther information
Out of scope (follow-up PRs)
action-button/index.tsx+action-button/secondary-button.tsx— pervasivehref/isExternalLink/weight— needs coordinated Link migrationplans-section/index.tsxButton usages — allvariant="link"+href+isExternalLink+weight="regular"(inlineTODOat top of file)golden-token/tooltip/index.tsx—variant="link"connection-status-card/index.tsxvariant="link"Button — kept on@wordpress/components@wordpress/icons, and per-component migrations (JetpackIcon, JetpackLogo, LoadingPlaceholder, Notice, Spinner, UpsellBanner, GlobalNotices, DotPager, ThemeProvider) — separate PRs per issue Jetpack UI Modernization #48160Real-screen before / after
Both screenshots captured on a live Jurassic Ninja site with Jetpack connected. Before = clean trunk rebuild (
54cb1b001a). After = this branch's build with the migrations applied.Both renders are pixel-identical (739,707 bytes each). DOM verification on the branch build:
__body-md,__body-sm,__heading-lg,__is-neutralclasses confirmed present — migration is live. No layout/visual regressions.Investigated an earlier visual "regression" I thought I saw in the Views chart — turned out to be a transient Stats-widget render state in my very first trunk screenshot (chart bars displayed at a larger relative height during initial data load). Subsequent renders of both trunk and this branch are identical. My PR does not affect the Stats widget.
Notes on the migration
pnpm jetpack build packages/my-jetpack --productionmust run beforepnpm jetpack build plugins/jetpack --production— the plugin build bundles pre-built package outputs, so package changes need to be refreshed first.@wordpress/uiat0.11.0to match forms, newsletter, publicize, charts, and js-packages/components. A version mismatch would cause pnpm to resolve two copies and their CSS module hashes to differ.@automattic/jetpack-componentsText renderstitle-medium→<h3>,body→<p>, etc.@wordpress/uiText always renders<span>. Callsites on the overview page do not rely on block-level defaults, so no layout impact observed, but this is a consideration for future migrations of files where the variant was carrying block-level styling.Testing instructions
admin.php?page=my-jetpack#/overview).