You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, @wordpress/admin-ui has a hard dependency on @wordpress/route to handle routing behaviors (e.g. in breadcrumbs links). This makes it difficult or impossible to use its components in projects which may have their own routing implementations.
This also creates conflicts between dependency versions. @wordpress/route depends on Tanstack Router, which in turn imposes its own set of requirements. This causes challenges in e.g. handling React version dependencies (see real-world example). There's also a question of whether multiple bundled versions of these packages can co-exist, since routing relies heavily on React context, but multiple versions (copies) of the same dependency cannot share React context.
What is your proposed solution?
Remove @wordpress/admin-ui's dependency on @wordpress/route, while providing an easy way for applications to specify the link rendering behavior of components like breadcrumbs.
This retains the high-level usefulness of the page component in handling generalized routing, while not being overly prescriptive/restrictive of the actual implementation.
What problem does this address?
Currently,
@wordpress/admin-uihas a hard dependency on@wordpress/routeto handle routing behaviors (e.g. in breadcrumbs links). This makes it difficult or impossible to use its components in projects which may have their own routing implementations.This also creates conflicts between dependency versions.
@wordpress/routedepends on Tanstack Router, which in turn imposes its own set of requirements. This causes challenges in e.g. handling React version dependencies (see real-world example). There's also a question of whether multiple bundled versions of these packages can co-exist, since routing relies heavily on React context, but multiple versions (copies) of the same dependency cannot share React context.What is your proposed solution?
Remove
@wordpress/admin-ui's dependency on@wordpress/route, while providing an easy way for applications to specify the link rendering behavior of components like breadcrumbs.What this might look like in practice:
Pagecomponent receives configurablebreadcrumbsprop, includinglabelandtoprops, like what was proposed in Admin UI: Page header design spec #76709 (comment)<Page breadcrumbs={ [ { label: 'Parent', to: '/' }, { label: 'Current' } ] } /><a /><Page components={ { link: Link } } />(or context provider if needed)@wordpress/boot) would provide this with the implementation ofLinkfrom@wordpress/route@wordpress/uiprimitive + admin-ui "wiring it up"This retains the high-level usefulness of the page component in handling generalized routing, while not being overly prescriptive/restrictive of the actual implementation.