Repository navigation
Conversation
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Backup plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Boost plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Search plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Starter Plugin plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Videopress plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Stats Data plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
f7254f5 to
5b7a4fa
Compare
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryCoverage changed in 64 files. Only the first 5 are listed here.
6 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
91ab971 to
e3cff84
Compare
wp-build requires "type": "module" on the package, which flips every .js file to ESM. No behavior change. Also adds the .ts extension to two relative imports in create-stat-diff-text.js: with "type": "module", webpack parses plain .js files (unlike .jsx) as strict ESM, which requires fully-specified import specifiers. This was the only file in the package with that shape. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pkmmvLXUXe6vnkMXSQDKQ
The wp-build stage and the legacy entry have to render one tree, not two copies that drift. admin.jsx keeps createRoot() and the onboarding branch, which reads a container that only exists on the legacy path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pkmmvLXUXe6vnkMXSQDKQ
wp-build's esbuild pipeline configures no image loader, so a bare import from './x.svg' fails to bundle. Data URIs keep the rendered <img src> identical. Follows packages/activity-log. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pkmmvLXUXe6vnkMXSQDKQ
~800K of WebP/PNG can't be inlined the way the SVGs were, and esbuild has no file loader, so they're copied to build/images/ and addressed through a runtime base exposed as myJetpackInitialState.assetsUrl. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pkmmvLXUXe6vnkMXSQDKQ
When the placeholder is not rendered, as on wp-build dashboards whose page CSS hides it, hold the card until #jp-admin-notices mounts instead of putting it where it stays invisible. Visible placeholders keep today's behaviour. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KmSAEMRaHggqug6jHrvY2
Boot's stage sets #1e1e1e, so text outside the admin-ui page region, such as the Connection screen footer wordmark, darkened against the legacy page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KmSAEMRaHggqug6jHrvY2
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KmSAEMRaHggqug6jHrvY2
|
Instead of using this can we use the new Feature Flags class? |
Replace the rsm_jetpack_ui_modernization_my_jetpack filter with the my-jetpack-wp-build Feature_Flags flag, registered at the top of init() so it is listed wherever the package loads, including WP-CLI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KmSAEMRaHggqug6jHrvY2
Done in d20e8c1. The gate is now the Generated by Claude. |
| @@ -0,0 +1,45 @@ | |||
| // Generated by `pnpm run generate:inline-svgs`. Do not edit. | |||
There was a problem hiding this comment.
Does this file make sense or should this be individual SVG icons?
that can be reused.
Having them in a file like this seems a bit odd to me because I can't really verify what they are.
There was a problem hiding this comment.
Good point. The SVGs stay as regular .svg files next to their components, and that's what to review. inline-svgs.ts is generated from them (pnpm run generate:inline-svgs), and inline-svgs.test.ts fails if it drifts. In 5ac4640 I marked it linguist-generated so GitHub collapses it in diffs, and each export now names its source file.
I kept them as <img> data URIs rather than reusable SVG components: each is used once, and inline <svg> would change the DOM. It would also break with this artwork, because jetpack.svg and empty-avatar.svg share SVGID_1_/Layer_1 ids and render side by side.
Generated by Claude.
The base64 blob can't be read in a diff, so mark it linguist-generated and name each export's source SVG, which is what reviewers should check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vb2Nnc9pDZgAt8zUkj7fnq
|
I looked at this PR for backward compatibility, as of Will the URL change?No.
Did any endpoints change?No.
What happens to a user on the old dashboard when the site updates?
API-level changes
|
the wp-build port (#52204) landed pinned to admin-ui 2.9, build 0.22, route 0.20 and the .54 train
* Update Bundled @wordpress/* monorepo * Fix patch for `@wordpress/build` v0.23.0 * align protect a11y pin with the bundled group * Backup: report unknown activity totals as null to DataViews dataviews 19 clamps the page to the last one it knows about, so a fallback of 1 sent the reader to page 1 whenever the log failed or was paused offline * wp-build-polyfills: keep reusable-blocks on the private-apis allowlist private-apis 1.55.0 dropped it, but the copy WordPress 7.0 ships still opts in * Premium Analytics: cast the report params Edit control like its key dataviews 19 adds setValue to NormalizedField, so the unresolved Attributes generic no longer unifies with the concrete control props * Boost: expect the theme 2.1 warning color in the overview e2e @wordpress/theme 2.1.0 moves --wpds-color-foreground-content-warning-weak from #926300 to #936300 * update @wordpress/* packages to the .55 train folds the wordpress-monorepo renovate round (#52188) so both trains land together and the tree stops carrying two copies of components, element and core-data * pnpmfile: drop the dataviews dependency hack dataviews 19 declares every dependency of its wp bundle itself (WordPress/gutenberg#81843), so the hack only duplicated them as optionalDependencies * refresh the pnpmfile checksum in the lockfile * align My Jetpack wp-build pins with the round the wp-build port (#52204) landed pinned to admin-ui 2.9, build 0.22, route 0.20 and the .54 train * dedupe the lockfile after the trunk merge collapses the testing-library 16.3.2 / 14.6.1 copies left behind trunk's #52297 bump * Forms: assert the console error useCreateForm logs jest-console 9.3.0 keeps its spies across jest.restoreAllMocks(), so the error the hook logs on a failed creation has to be expected * Charts: wrap useElementSize test updates in act() jest-console 9.3.0 surfaces the act() warnings that clearAllMocks() used to discard before the console assertion ran * Social: pre-fill the Bluesky handle on reconnect InputControl spreads defaultValue onto its controlled input, so the handle never showed and React warned; keep the handle in state * Jetpack: await the Newsletter email toggle in its test ToggleGroupControl settles its radio store after render, and jest-console 9.3.0 now reports that act() warning * Jetpack: fix the Popover ignoreContext prop type PropTypes.function does not exist, so the shape check only logged a warning that jest-console 9.3.0 now reports * VideoPress: narrow the files transform before calling it blocks 16 types findTransform's result as the union of every transform kind, and files.isMatch takes the file list alone * e2e: accept both labels of the preview menu item e2e-test-utils-playwright 2.0.0 looks for Gutenberg trunk's 'Preview (opens in a new tab)', while the WP 7.0/7.1 editor still says 'Preview in new tab', so Forms' openPreviewPage never found it * e2e: match the View button exactly the substring match also resolved Document Overview in the editor top bar * PayPal: drop the spy tracking jest-console needed jest-console 9.3.0 keeps its console spies across restoreAllMocks(), so afterEach can restore every spy the suite made again * recolor stroke-based icons with color, not fill @wordpress/icons 16 draws 98 icons as strokes with an inline fill:none, so the CSS fill rules that tinted them stopped applying; the AI message keeps fill for its own filled SVG --------- Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com> Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
Boot's stage already sets the design-system foreground color. My Jetpack's dashboard and the Jetpack Settings page each overrode it with wp-admin's classic #3c434a, which has no WPDS token. Follow-up to #52204 and #52619 per review feedback asking for no overrides on Page's own design choices. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fixes JETPACK-2567
Proposed changes
Ports the My Jetpack dashboard onto the wp-build pipeline, behind a feature flag that defaults to off. This is the pilot for JETPACK-2566; the traps it hit are written up for the porting checklist in JETPACK-2575.
The rule for this port is move the frame, keep the UI. The UI is unchanged apart from the frame itself.
path: "/"whosestage.tsxrenders the existing React tree with itsHashRouterintact. Boot's router reads its path from a?p=query parameter and never the hash, so every#/…deep link keeps working — ~56 references inside this monorepo, plus links from WordPress.com, support docs and upgrade emails. No URL changes.Admin_Menu::add_menuinclass-initializer.phpandclass-jetpack-manage.phpare untouched;admin_page()became a dispatcher instead.admin_enqueue_scriptscallbacks and JITMs keep the realjetpack_page_my-jetpackID.?step=onboardingdeliberately stays on the legacy path. It is a full-viewport takeover that hides all wp-admin chrome, so it has no frame to standardize. Verified that the flag does not change its behaviour.my-jetpack-wp-buildfeature flag, default off. Every user still gets today's dashboard. Enable it withwp companion feature-flag enable my-jetpack-wp-build, or locally withadd_filter( 'jetpack_feature_flag_enabled_my-jetpack-wp-build', '__return_true' );.Changes outside
packages/my-jetpackesbuild has no image loader and no config surface, and that follows the route's whole import graph — not just the ported package.
packages/connectionandpackages/licensingnow serve their own illustrations from a committedassets/images/directory, with the base URL published in admin script data (followingpackages/blaze's precedent).js-packages/connectionandjs-packages/licensingresolve their own URLs; no consumer passes anything. Data URIs were rejected here on measurement: those four total ~337KB gzipped, versus the ~22KB accepted for My Jetpack's own SVGs.js-packages/componentsinlines the pricing table's header gradient as a data URI, because runtime-injected CSS resolvesurl(./gradient.svg)against/wp-admin/.js-packages/configfalls back toglobalThis.jetpackConfigwhen the webpack external is missing. My Jetpack's boot init module sets it, soconsumer_slugsurvives esbuild.js-packages/connectiondrops the manage-connection dialog's link colors.@wordpress/uiinjects Link's CSS at runtime, after every<link>, so they never won under webpack; bundled, they turned the links black.packages/jitm: when a JITM placeholder isn't rendered, as on wp-build pages whose CSS hides it, the card now waits for#jp-admin-noticesto mount instead of taking the hidden placeholder's spot. Pages with a visible placeholder behave as before.tools/performance: the My Jetpack CodeVitals scenario waits for.jp-admin-pageunder either container, so it keeps working once the flag is on.Effects on the default (flag-off) path
The flag is off, so every user takes the legacy path. Four deliberate, measured trade-offs reach it:
resolve.aliasif it turns out not to be.build/images/at unhashed paths with noverquery, so an image changed by a plugin update can be served stale.connection.assetsUrl,licensing.assetsUrlandmyJetpack.assetsUrlare now added towindow.JetpackScriptDataon every wp-admin page of every plugin bundling those packages — three short strings.myJetpack.assetsUrlis registered even where My Jetpack itself is turned off, because the Jetpack plugin still renders its connection screen there.build/routesis ~8.7 MB on disk (content.min.js~3 MB, 777 KB gzipped). It loads only when the flag is on, the same as the other wp-build pilots.Otherwise unchanged: same script handle, same arguments, same three state payloads. The design tokens import moved from
_inc/style.module.scssinto a legacy-only_inc/design-tokens.scss; the legacy bundle already carried two identical copies of those tokens, so only their order changed.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. No new tracking, no new data collection. The three script-data keys added are asset base URLs.
Testing instructions
The flag is off by default, so first confirm nothing changed, then enable it and compare.
Before (flag off — this is what ships):
?page=jetpack) while disconnected — the "link your WordPress.com account" screen should show its hero illustration. (This screen imports a My Jetpack component; an earlier revision of this PR broke its image, so it is worth an explicit look.)#/add-backup) — the featured column keeps its header gradient.After (flag on):
admin.php?page=my-jetpack#/add-backup. All should work — this is the nested-router check.wp:jetpack_page_my-jetpack…message paths, and there is no 404 for adesign-tokens.cssunder/wp-admin/.admin.php?page=my-jetpack&step=onboarding. On a connected site it redirects to#/overview, exactly as with the flag off.Verification already done
Measured on one site, one viewport, changing only the flag — computed styles and geometry diffed numerically rather than eyeballed, because a 4px change is invisible in a screenshot:
#wpbody-content.jp-admin-page.jetpack-footerbodyfont-familyThe only difference is a uniform 8px inset — the boot stage's gutter, which is the frame this port exists to adopt. Body content, typography and spacing are unchanged.
That comparison, extended to every route and dialog, plus live checks found and fixed these defects in this PR: a CJS/ESM interop failure that blanked the dashboard, a body font-family drift, missing charts and DataViews stylesheets, the pricing table gradient 404, logo heights overridden by boot's image reset, black manage-dialog links, a lost
consumer_slug, a JITM message path renamed by the screen alias, and a design-tokens@importthat 404'd on every load. The last two change no pixels, so they were caught by comparing requests rather than styles.A later review, also checked live with the flag both off and on, fixed two more:
#jp-admin-notices, and a faster response went into a placeholder that wp-build's CSS hides. Verified with an injected JITM: it now waits and renders inside#jp-admin-notices, and flag-off placement is unchanged.#1e1e1einstead of wp-admin's#3c434a(the Connection screen's footer wordmark). The stage now pins#3c434a, and the Connection screen matches flag-off row for row.🤖 Generated with Claude Code
https://claude.ai/code/session_016F3z1Uq6h1JiuGiGzo9iSZ
https://claude.ai/code/session_011KmSAEMRaHggqug6jHrvY2