Skip to content

Conversation

@meirish
Copy link
Collaborator

@meirish meirish commented Dec 8, 2025

📌 Summary

👋 Hey hi there folks! This is something that has been bouncing around my head for a bit because I know there have been issues with ember-engines and its LinkToExternal component. Namely: it's a small subset of our applications that require it, but with it configured as a peerDependency of the design system, apps that don't require it still need to install it. This is an alternative proposal for handling external link components in HDS.

🛠️ Detailed description

So what's this PR do? The error messages I added describes it best:

HdsBreadcrumbItem: You attempted to use an external link without configuring HDS with an external component. Please add this in your app.js file:

import { setLinkToExternal } from '@hashicorp/design-system-components/utils/hds-link-to-external';
setLinkToExternal(LinkToExternalComponent);`

So setLinkToExternal can now take a reference to a Link component that HdsInteractive and HdsBreadcrumbItem will both use instead of loading the LinkToExternal component from ember-engines. I would have preferred to pass in the component as an arg directly, but this way the API remains the exact same for consumers (as does almost all of the implementation in HDS). Additionally, apps that don't need engines don't have to do anything. Apps that do use engines have to add a few lines in the app.js file to configure the class appropriately. All that and no messy dependency issues.

I didn't get a chance to test this in a real application yet, but one of the nice things with the new approach is that it's testable - I just configured the components with the built-in LinkTo component in tests.

So what do you think? Happy to discuss in comments here or in Slack!

Thanks!

🔗 External links

Slack thread


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@meirish meirish requested a review from a team as a code owner December 8, 2025 23:10
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Dec 9, 2025 5:19pm
hds-website Ready Ready Preview Dec 9, 2025 5:19pm

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📦 RC Packages Published

Latest commit: aac21ce

Published 2 packages

@hashicorp/design-system-components@5.1.1-rc-20251210200104

yarn up -C @hashicorp/design-system-components@rc

@hashicorp/flight-icons@4.1.1-rc-20251210200104

yarn up -C @hashicorp/flight-icons@rc

@shleewhite shleewhite removed the release-candidate Publishes release candidates to npm label Dec 9, 2025
@shleewhite
Copy link
Contributor

Testing this solution in this PR: https://github.com/hashicorp/cloud-ui/pull/13369 (it is the rc in the second commit).

// we want to avoid resolving the component if it's not needed
if (args.isRouteExternal) {
void this.resolveLinkToExternal();
import { HdsBreadcrumbItem } from @hashicorp/design-system-components/components;'
Copy link
Contributor

Choose a reason for hiding this comment

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

@shleewhite do you think we can simply replace the link inside the HdsBreadcrumbItem with the HdsInteractive components, so all this logic is centralized in a single place/component?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought that too - but I didn't know the history of why that's separate. I assume there was some reason for it.

I just pushed the change that @fivetanley suggested too which at least centralizes the configuration so that consumers don't have to import every individual component class to override things. I think that helps some, and then inside of HDS the details are up to you all.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought that too - but I didn't know the history of why that's separate. I assume there was some reason for it.

As far as I remember (I implemented the Breadcrumb component) no specific reason, simply the HdsBreadcrumb was implemented long before the HdsInteractive component, and we never replaced its internal implementation (unless I am missing something and we had to make an exception, maybe @shleewhite have some recollection?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I dont know anything about it.. I think it was before my time

@meirish
Copy link
Collaborator Author

meirish commented Dec 16, 2025

Tested a build in a branch here: https://github.com/hashicorp/cloud-ui/pull/13382

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.

4 participants