Dashboard: rename WidgetChrome to DashboardWidgetChrome#78751
Conversation
parametric 0-9 glyphs with per-stroke gradients, all WPDS tokens
the data layer is a host-agnostic widget toolkit, not only types
getLazyWidgetComponent moves to widget-kit/tools; widget-dashboard no longer declares the contract types
drop the widget-dashboard re-exports; WidgetModule and UseWidgetTypesResult stay internal to the kit
define what the toolkit is and its purpose; use host instead of surface; note the future private @wordpress/widget-kit package
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 8.18 MB ℹ️ View Unchanged
|
|
Flaky tests detected in c014c96. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/26531860928
|
What?
A no-behavior refactor of the dashboard render engine (
routes/dashboard/widget-dashboard), behind the experimentalgutenberg-dashboard-widgetsflag:WidgetChrometoDashboardWidgetChrome(folder, files, export, and props type).WidgetDashboard.WidgetChrome(theWidgetDashboardnamespace already implies the host, so the member name does not repeat "Dashboard").WidgetDashboard.Widgetcompound member that does not exist (it isWidgetChrome), andwidget-render.tsxreferenced the same phantom name. Both now point toDashboardWidgetChrome/WidgetDashboard.WidgetChrome.widget-primitives(no longer a future@wordpress/widget-typesre-export).tools/eslint/suppressions.json.Why?
The chrome that wraps a widget on a host follows a
{Host}WidgetChromeconvention (DashboardWidgetChrometoday, a futureSidebarWidgetChrome, and so on), so the dashboard's wrapper should carry the host prefix. The README and a couple of comments had drifted from the code (documenting a.Widgetmember that never existed); this corrects them.Behavior
None changed. This is a rename plus documentation fixes. The component, its props, and the rendered output are identical.
How?
git mvfor the folder and files; renamed the export, the props interface, and the three call sites; the compound member mapsWidgetChrome: DashboardWidgetChrome. Typecheck is clean, the 58 dashboard route unit tests pass, and lint/format pass (the pre-existing@wordpress/uiNoticesuppression was moved to the new path).Notes
Stacked on #78749 (
refactor/widget-primitives); the diff shown here is only this branch's changes. It will rebase ontotrunkonce #78749 merges.