Skip to content

Test: add @wordpress/admin-ui to verify CI compatibility - #109505

Closed
CGastrell wants to merge 2 commits into
trunkfrom
test/admin-ui-ci-check
Closed

CGastrell wants to merge 2 commits into
trunkfrom
test/admin-ui-ci-check

Conversation

@CGastrell

@CGastrell CGastrell commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds @wordpress/admin-ui as a dependency to wp-calypso, enabling use of the Page/Header components for Jetpack page header unification (JETPACK-1361).

Problem

Adding @wordpress/admin-ui pulls in @wordpress/route as a transitive hard dependency, which in turn requires @tanstack/react-router@^1.120.5. This conflicts with the Dashboard's existing @tanstack/react-router@^1.114.34 in two ways:

  1. yarn dedupe upgrades TanStack Router to the latest version satisfying both ranges (currently 1.168.3), which:

    • Uses React.use() — a React 19-only API, causing Webpack build failures on React 18
    • Has breaking API changes that cause Dashboard test failures (20 suites, 154 tests)
  2. Without dedupe, Yarn creates a nested copy under @wordpress/route/node_modules/, and CI's yarn dedupe --check rejects the PR for having duplicated packages.

Solution

Pin @tanstack/react-router to 1.114.34 (Dashboard's current version) via resolutions in root package.json:

"resolutions": {
    "@tanstack/react-router": "1.114.34"
}

This forces all consumers — Dashboard and @wordpress/route — to use the same version. Single copy, no upgrade, no breaking changes. The resolution pins below @wordpress/route's declared ^1.120.5 range, but this is safe because:

  • We only use admin-ui's Page/Header components, which don't touch @wordpress/route at all
  • @wordpress/route only re-exports TanStack Router APIs — the subset used is compatible with 1.114.34

Test results

TanStack version Copies Dedupe Dashboard tests (767) Webpack build
1.114.34 (trunk, no admin-ui) 1 Clean All pass OK
1.168.3 (dedupe without pin) 1 Clean 154 fail Fail (React.use)
1.162.8 (pinned) 1 Clean 154 fail OK
1.114.34 (pinned, this PR) 1 Clean All pass OK

Long-term considerations

This resolution is a workaround. Proper fixes include:

  • Upstream: @wordpress/admin-ui should make @wordpress/route a peer/optional dependency (only Breadcrumbs needs it; Page/Header don't)
  • Dashboard upgrade: bump TanStack Router to a version compatible with @wordpress/route's range
  • React 19 migration: would allow latest TanStack Router without conflicts

@matticbot

matticbot commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center

To test WordPress.com changes, run install-plugin.sh $pluginSlug test/admin-ui-ci-check on your sandbox.

@CGastrell
CGastrell marked this pull request as ready for review March 24, 2026 14:21
Adding @wordpress/admin-ui as a dependency to verify whether CI tests
pass when the package is properly installed with yarn dedupe.

This is a test PR — do not merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the test/admin-ui-ci-check branch from b229258 to 50c2dd2 Compare March 24, 2026 14:46
Adding @wordpress/admin-ui as a dependency. Pin @tanstack/react-router
to 1.114.34 via resolutions to prevent yarn dedupe from upgrading it
to 1.162.8+ which has breaking changes for Dashboard tests.

The resolution forces @wordpress/route (admin-ui's transitive dep) to
use the same TanStack Router version Dashboard already uses, avoiding
both the version incompatibility and the React.use() issue in 1.168.3+.

This is a test PR — do not merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants