Skip to content

Pin the widget dashboard packages to the 202609031004 dev release - #51939

Merged
retrofox merged 6 commits into
trunkfrom
update/wordpress-next-packages
Sep 4, 2026
Merged

retrofox merged 6 commits into
trunkfrom
update/wordpress-next-packages

Conversation

@retrofox

@retrofox retrofox commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

What?

Pins three @wordpress/* dependencies to the 202609031004 Gutenberg development release, published under the next dist-tag: widget-dashboard, widget-primitives and dataviews.

Premium Analytics picks up the widget dashboard policy API (WidgetDashboard.Policy), which governs what users may do on a dashboard: customize, reset, insert, and per instance remove, move, resize and edit.

dataviews crosses a major version boundary, from 18.1.0 to 19.0.1.

Why?

The two widget packages cannot move alone. widget-primitives@0.6.2-next declares dataviews@^19.0.1-next as a floor, so leaving dataviews at 18.1.0 gives Field two type identities, and WidgetAttributeField<Attributes> stops unifying. Type checking fails in packages/fields/src/report-params-field/report-params-field.tsx. Adding dataviews makes the set installable; nothing beyond it is required.

wp-build-polyfills moves the same two shared entries because Premium Analytics consumes @wordpress/widget-primitives as a script module served by the polyfill bundle rather than from its own bundle.

Everything else stays on stable on purpose.

A wider pin was measured and rejected: pinning all 39 @wordpress/* entries across both packages produced 34 duplicated packages in the Premium Analytics tree against 33 for this three-entry pin, so it does not reduce duplication. ui, icons and style-runtime stay duplicated under either strategy because charts, jetpack-components and jetpack-connection hold the stable copies, and neither pin touches those.

The wider pin's only measurable gain was a single dataviews copy instead of two, at the cost of moving private-apis, rich-text, route, theme, views, boot and a11y onto the dev release for the eleven other projects that consume the polyfill bundle, and dragging core-data across a major that Premium Analytics does not need.

How?

projects/packages/premium-analytics/package.json

Pins widget-dashboard, widget-primitives and dataviews to their 202609031004 versions, as exact pins rather than ranges, since a caret over a prerelease admits a confusing mix of stable and prerelease resolutions.

projects/packages/wp-build-polyfills/package.json

Pins widget-primitives and dataviews to the same versions, so the module the polyfill bundle serves matches what Premium Analytics builds against.

.pnpmfile.cjs

Collapses any prerelease @wordpress/private-apis range onto the version premium-analytics declares (1.54.0 today), so the lock holds a single copy. widget-dashboard unlocks @wordpress/components' private APIs, and that lock/unlock pair resolves through a module-scoped registry, so both sides must be the same copy. The rule matches only -next ranges and leaves devDependencies alone: it stops applying by itself once the pins move to stable, and the polyfill bundle keeps serving the stable private-apis its other consumers expect.

The dev-release widget-dashboard declares ^1.54.2-next… while the stable components this repo resolves declares ^1.54.0, and a prerelease range and a stable one never converge on one package. Without it, every Premium Analytics story fails to import with Cannot unlock an object that was not locked before. It lives in .pnpmfile.cjs rather than pnpm-workspace.yaml, per the repo convention enforced by check-pnpm-workspace-yaml.mjs.

pnpm-lock.yaml

Regenerated from trunk's lock with the rule above, so the diff carries only the widget-dashboard subtree and the private-apis collapse.

routes/dashboard/hooks/use-dashboard-grid-settings

Pins columns to WIDGET_DASHBOARD_COLUMN_COUNT on read, as the wp-admin dashboard does. 0.7.1 honours a stored columns, and preferences written by the removed Columns control still carry one; the placements are authored for four.

Nested package.json files

The link: manifests under routes/, widgets/ and packages/ name the same versions as the root manifest, as the last group bump did.

changelog/pin-widget-dashboard-dev-release

One entry per touched package, both patch / changed.

Testing

Type checking passes on premium-analytics with no errors.

The Storybook suite passes in full: 251 files, 1266 tests, 46 skipped, nothing failing. Without the private-apis collapse, the same run has 80 files failing to import, so it is what makes this pin viable rather than a convenience.

Four narrower attempts did not hold, for the record: adding @wordpress/private-apis to Vite's dedupe list, and pinning private-apis in premium-analytics, components in premium-analytics, and components in js-packages/storybook.

None of them help because a prerelease range and a stable one cannot resolve to a single package, no matter which manifest asks.

The handles and modules the polyfill bundle serves to other projects remain unchanged by this pin, except for @wordpress/widget-primitives, which other consumers register but do not use.

To reproduce: jetpack build --deps packages/premium-analytics, then open Stats v2 and confirm the dashboard renders, its widgets accept resize and move, and the Customize flow works. The package provenance module in the Debug Helper plugin shows which runtime serves each package; @wordpress/widget-primitives should appear as POLYFILL and active on that screen.

Follow-ups

  • Delete the @wordpress/private-apis rule in .pnpmfile.cjs together with these pins. It only matches prerelease ranges, so it is inert once the group moves together on latest.
  • Replace these pins with stable versions once the packages ship on the latest dist-tag. Renovate covers all three in the Bundled @wordpress/* monorepo group, but it will not propose widget-dashboard 0.7.0 or dataviews 19.0.0: both compare lower than these prerelease pins. Move those two by hand when they ship; 0.7.1 / 19.0.1 and later are picked up on their own.
  • dataviews resolves to two copies in the Premium Analytics tree, 18.1.0 via admin-ui and 19.0.1 here. Pinning admin-ui too was measured and made things worse (35 duplicates), so this is left for the stable release to resolve.
  • Three sibling workspace packages (charts, jetpack-components, jetpack-connection) pin the stable ui, icons and components, so those stay duplicated in the tree regardless of this change.

@retrofox
retrofox requested a review from a team as a code owner September 3, 2026 11:53
@retrofox retrofox self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/wordpress-next-packages branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/wordpress-next-packages
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/wordpress-next-packages

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add testing instructions.
  • 🔴 Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 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:

## Does this pull request change what data or activity we track or use?

My PR adds *x* and *y*.

Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Sep 3, 2026
@jp-launch-control

jp-launch-control Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/routes/dashboard/hooks/use-dashboard-grid-settings/use-dashboard-grid-settings.ts 9/12 (75.00%) 75.00% -9 💚

Full summary · PHP report · JS report

202609031004, plus dataviews so their types unify
@retrofox retrofox added [Status] In Progress and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Sep 3, 2026
@retrofox
retrofox force-pushed the update/wordpress-next-packages branch from 8d728a9 to f424e39 Compare September 3, 2026 12:09
@retrofox retrofox changed the title Pin @wordpress packages to the 202609031004 dev release Pin the widget dashboard packages to the 202609031004 dev release Sep 3, 2026
@retrofox

retrofox commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Runtime validation

Tested across both ends of the supported WordPress range and four Gutenberg states, on the two pages that consume the polyfill bundle. The pin is identical in every cell, so any differences between them come from runtime rather than this change.

The Gutenberg rungs are chosen to sit on either side of the thresholds in WP_Build_Polyfills: GUTENBERG_PRIVATE_APIS_MIN_VERSION 23.5.0, GUTENBERG_RICH_TEXT_MIN_VERSION 23.6.0, GUTENBERG_WIDGET_PRIMITIVES_MIN_VERSION 23.9.0.

WP Gutenberg Stats v2 Forms what the polyfill actually serves
7.0.4 off renders renders private-apis + rich-text force-replacing Core, widget-primitives; views idle
7.0.4 23.5.0 renders renders rich-text still forced (GB below 23.6.0), widget-primitives; views idle
7.0.4 23.8.0 renders renders widget-primitives only; views idle
7.0.4 23.9.0 renders renders nothing in use; views idle
7.1 off renders renders widget-primitives; views idle
7.1 23.8.0 renders renders widget-primitives; views idle
7.1 23.9.0 renders renders nothing in use; views idle

No breakage in any cell. Provenance read with the package provenance module in the Debug Helper plugin; "idle" means registered but unused on that screen.

The per-package thresholds resolve independently, which the 7.0.4 + 23.5.0 cell shows cleanly: private-apis is released to Gutenberg because 23.5.0 meets its threshold, while rich-text stays force-replaced because 23.5.0 is below 23.6.0.

Where the pin applies, and where it does not

Of the three pinned packages, only one is externalized. widget-dashboard and dataviews are compiled into the Premium Analytics bundle, so the pinned versions always run and cannot be replaced. The policy API this pin is for is bundled: canPerform appears 38 times in build/routes/dashboard/content.js.

widget-primitives is a script module, so its provider depends on the environment. The polyfill serves the pinned 0.6.2-next in five of the seven cells.

In the two cells with Gutenberg 23.9.0, the polyfill stops deregistering the module, and Gutenberg's copy wins, with script modules being first-wins.

That last case is benign. Both copies export the same six symbols, WidgetHostProvider, WidgetRender, registerFieldType, registerIconResolver, useWidgetHost, and useWidgetTypes, which matches widget-primitives gaining only documentation entries between 0.6.0 and 0.6.2-next. Both pages render either way.

The Gutenberg 23.8.0 cells are the mirror case and confirm the deregistration path: there widget-primitives reports POLYFILL with the pinned build's hash, so Gutenberg's older copy is displaced as intended.

Icons

@wordpress/icons stays on stable 15.5.0 here, so Premium Analytics' own icons are untouched by the stroke-based redraw in 16.0.1. widget-dashboard bundles its own 16.0.1 for its chrome. Inspected the chart-type toggle, widget header icons, info affordances and select chevrons at 4x: all render as outlines, none as filled shapes.

Two observations unrelated to this change

The Traffic summary metric values render at a smaller type size on WP 7.0.4 with Gutenberg off, and larger everywhere else. It follows whichever runtime provides wp-theme and wp-components: Core 7.0.4 (small), Core 7.1, and Gutenberg (large). The pin is constant across all cells, so this is a Core-version difference.

Gutenberg 23.5.0 cannot run on WordPress 7.1 at all. It fatals with Access level to WP_Icons_Registry_Gutenberg::register() must be public (as in class WP_Icons_Registry), a plugin/Core incompatibility that predates this branch. That combination was tested on 7.0.4 instead.

Environment restored

Back on WP 7.1, Gutenberg deactivated at 23.9.0, major Core auto-updates re-enabled.

@retrofox
retrofox requested a review from a team as a code owner September 3, 2026 13:08
@retrofox
retrofox force-pushed the update/wordpress-next-packages branch from f2a372d to 64397ad Compare September 3, 2026 14:14
@retrofox
retrofox marked this pull request as draft September 3, 2026 14:19
@retrofox
retrofox force-pushed the update/wordpress-next-packages branch from 64397ad to d26d7e1 Compare September 3, 2026 14:20
@retrofox
retrofox marked this pull request as ready for review September 3, 2026 14:26
its lock/unlock pair cannot span a stable and a prerelease copy
@retrofox
retrofox force-pushed the update/wordpress-next-packages branch from d26d7e1 to a8060e7 Compare September 3, 2026 14:30
kangzj
kangzj previously approved these changes Sep 4, 2026

@kangzj kangzj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests well for me 👍 Took it for a spin on the docker env (WP 7.1, Gutenberg 23.9.0) with Gutenberg on and off - the dashboard renders, resize / move / widget options / inserter all work and the layout survives a reload, and with Gutenberg off @wordpress/widget-primitives is served from the polyfill bundle like the description says. No console errors in any run. Approving, with a couple of suggestions - two inline, and two here because there's no diff line to hang them on.

One small thing on the description: "collapses @wordpress/private-apis onto a single copy" isn't quite what the lock ends up with - there are still two copies (1.54.0 for wp-build-polyfills and charts, which declare it under devDependencies), more on that inline.

Suggestions with nowhere to anchor

  • widget-dashboard 0.7.1 starts honouring gridSettings.columns (0.6.0 hard-coded 4, 0.7.1 runs it through resolveDashboardColumnCap with floor 1 and no ceiling), and useDashboardGridSettings passes the stored preference straight through - normalizeGridSettings only snaps rowHeight. I tried it: a dashboardGridSettings preference with columns: 2 re-lays the whole dashboard out at 2 columns on this branch (Top pages goes full width, Top referrers takes half), where trunk ignores it. Nothing in PA ever wrote columns as far as I can tell so there's no stale data out there, but the placements are authored for 4, so I'd pin columns in the hook rather than leave it to whatever is in user meta. Not a blocker, just feels like a cheap guard.
  • Only the root manifest moved - 86 nested link: manifests (packages/externals, packages/fields, packages/widgets-toolkit, routes/*, widgets/*) still say widget-dashboard 0.6.0 / widget-primitives 0.6.0 / dataviews 18.1.0. pnpm doesn't care, but the last group bump (#51701) updated them in lockstep, and hello-world is what people copy from, so probably worth keeping them in sync (or a note on why not).

Testing - docker env on this PR head (a8060e7), Playwright at 1440x900, "before" build = merge base 1f94226.

What was checked What happened Status
pnpm install --frozen-lockfile on the PR head Lock in sync with the manifests + pnpmfile hook, supply-chain policy check passes ✅
jetpack build --deps packages/premium-analytics, plus my-jetpack / plugins/jetpack / plugins/premium-analytics Clean builds, polyfill export-contract and boot-asset validators pass ✅
premium-analytics tsgo --noEmit No errors ✅
premium-analytics jest 155 suites / 3040 tests pass ✅
wp-build-polyfills node --test Pass ✅
Storybook vitest (js-packages/storybook) 251 files / 1266 tests pass, zero Cannot unlock ✅
Stats v2 dashboard, Gutenberg 23.9.0 active 11 widgets render, 0 page/console errors; provenance shows widget-primitives / boot / route from Gutenberg ✅
Stats v2 dashboard, Gutenberg deactivated 11 widgets, 0 errors; @wordpress/widget-primitives served from jetpack-wp-build-polyfills/build/modules/widget-primitives, boot / route / a11y from core ✅
Customize → resize Traffic summary (drag handle +120px) 416px → 632px, snaps to one grid row ✅
Customize → move Top pages after Top referrers (mouse drag, and keyboard Space / → / Space) Order becomes Traffic summary > Top referrers > Top pages > Devices with both sensors ✅
Widget options popover, Add widget inserter Popover shows the width options, inserter lists the widgets with live data ✅
Done → reload One POST /wp/v2/users/me, resized height and new order persist ✅
Polyfill bundle served to the other 11 consumers Asset hashes for private-apis / rich-text / theme / views / notices / boot / route / a11y identical before and after; only widget-primitives changes (36f1b5f4… → a2955fa4…) and it exports the same 6 symbols as 0.6.0 ✅
Another wp-build page (Newsletter), Gutenberg on and off Loads fine, only a pre-existing jetpackConfig is missing console error that is there on trunk too ✅
Stored dashboardGridSettings.columns: 2 preference Trunk ignores it, this branch lays out at 2 columns (see suggestion above); default preference unchanged at 4 ✅
Forced wp-private-apis polyfill path (WP < 7.1) Env is WP 7.1 so not exercised live; bundle hash unchanged from trunk (0881669ca00af9ea3176) ⚠️
Bundle size dashboard route 1578 → 1593 KB min (+15 KB), externals 1879 → 1868 KB, whole build 55.7 → 55.3 MB ✅

Evidence - dashboard on the merge base vs this PR, and the customize flow recorded on the PR build.

Before (trunk 1f94226) After (PR a8060e7)
before after

customize flow

Thanks Damián!

Comment thread .pnpmfile.cjs Outdated
Comment on lines +85 to +87
if ( pkg.dependencies?.[ '@wordpress/private-apis' ] ) {
pkg.dependencies[ '@wordpress/private-apis' ] = '1.54.2-next.v.202609031004.0';
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This lifts every stable consumer in the repo onto the dev release (mu-wpcom, the jetpack plugin's admin-ui / edit-post peers etc), and it still leaves two copies in the lock because devDependencies aren't touched - wp-build-polyfills and charts stay on 1.54.0. Which is actually what we want for the polyfill bundle I think (1.54.2-next dropped @wordpress/reusable-blocks from the allowlist, so the stable reusable-blocks the jetpack plugin still depends on would throw on opt-in against the dev copy - latent today since nothing loads it in tests), but it's kinda accidental as written.

I gave the reverse a spin - only rewrite the prerelease range, and point it at the stable line the repo already pins: the lock collapses to ONE private-apis copy (1.54.0), PA typecheck passes and the Storybook suite is the same 251 files / 1266 tests green. Plus it stops matching by itself once the pins move to stable, so the follow-up can't be forgotten. What do you think?

Suggested change
if ( pkg.dependencies?.[ '@wordpress/private-apis' ] ) {
pkg.dependencies[ '@wordpress/private-apis' ] = '1.54.2-next.v.202609031004.0';
}
if ( pkg.dependencies?.[ '@wordpress/private-apis' ]?.includes( '-next' ) ) {
pkg.dependencies[ '@wordpress/private-apis' ] = '1.54.0';
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Went with the reverse, with one twist: the rule rewrites only -next ranges to the version premium-analytics declares, rather than a literal 1.54.0, so the next stable bump of private-apis moves the target too (charts and social-previews still pin theme@2.1.1-next on trunk, which declares a prerelease range, and a literal would split the copies again there). One private-apis copy in the lock, devDependencies untouched, and the rule is inert once nothing asks for a prerelease.

Comment thread pnpm-lock.yaml Outdated
@@ -7947,8 +7947,8 @@ packages:
resolution: {integrity: sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==}
hasBin: true

'@bufbuild/protobuf@2.12.1':
resolution: {integrity: sha512-BvAMfS6LrgZiryOAZ4pBYucu4wG/Ei/9o9DZ9akbREnMLbPJiom2i8b9C8IsKErQoiKqVhrerzt3kOT/RrzLHg==}
'@bufbuild/protobuf@2.14.1':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few unrelated transitive bumps ride along in here (@bufbuild/protobuf 2.12.1 → 2.14.1, @codemirror/lang-markdown, @lezer/*, @redux-saga/*) - nothing in the manifests asks for them, so I guess pnpm install resolved fresh. Regenerating from trunk's lock (git checkout origin/trunk pnpm-lock.yaml && pnpm install) should keep them where they are and still update the widget-dashboard subtree + the pnpmfile checksum. Not a big deal, just keeps the lock diff to what the PR is about.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Regenerated from the trunk's lock as suggested. The diff now includes the widget-dashboard subtree and the private-apis collapse; the transitive bumps are gone.

rewrites only -next ranges to the version premium-analytics declares; lock regenerated from trunk's
widget-dashboard 0.7.1 honours a stored columns preference; placements are authored for four
@retrofox

retrofox commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Applied the two suggestions without a diff line to hang them on: columns are pinned on read in useDashboardGridSettings (with a test; stored columns: 2 now lay out at four), and the 86 nested link: manifests name the same versions as the root.

Reset is in the description now too. Thanks for the thorough run.

@retrofox
retrofox merged commit 2a716f4 into trunk Sep 4, 2026
120 checks passed
@retrofox
retrofox deleted the update/wordpress-next-packages branch September 4, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants