-
Notifications
You must be signed in to change notification settings - Fork 49
Proposal: Allow configuration of external link component #3429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1112bcf to
361bafa
Compare
361bafa to
8715ccc
Compare
📦 RC Packages PublishedLatest commit: aac21ce Published 2 packages@hashicorp/design-system-components@5.1.1-rc-20251210200104@hashicorp/flight-icons@4.1.1-rc-20251210200104 |
|
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;' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
8715ccc to
aac21ce
Compare
|
Tested a build in a branch here: https://github.com/hashicorp/cloud-ui/pull/13382 |
📌 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-enginesand itsLinkToExternalcomponent. Namely: it's a small subset of our applications that require it, but with it configured as apeerDependencyof 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:
So
setLinkToExternalcan now take a reference to a Link component thatHdsInteractiveandHdsBreadcrumbItemwill both use instead of loading theLinkToExternalcomponent fromember-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 theapp.jsfile 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
LinkTocomponent 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
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.