feat(components): simplify reexport and add type reexport example
:pushpin: Summary
- simplify reexport for components (might need to split and clean up some non top level reexports as intentions of this files is to only export top level components, non top level component will never be imported directly)
- add example of type reexport (enum specifically)
:hammer_and_wrench: Detailed description
:camera_flash: Screenshots
:link: External links
Reference: https://hashicorp.slack.com/archives/C06NMSYDZPA/p1722372651081339
Jira ticket: HDS-XXX Figma file: [if it applies]
👀 Component checklist
- [ ] Percy was checked for any visual regression
- [ ] A changelog entry was added via Changesets if needed (see templates here)
:speech_balloon: Please consider using conventional comments when reviewing this PR.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| hds-showcase | ✅ Ready (Inspect) | Visit Preview | Sep 10, 2024 1:55am |
| hds-website | ✅ Ready (Inspect) | Visit Preview | Sep 10, 2024 1:55am |
@aklkv is still in progress or ready to review?
@didoo got confused half way through when I realized that at some point this file started to contain more then just tope level components, which was initial intent. I conceptually this PR is ready for initial feedback but I need to clean it up to only contain top level components and it's types.
@didoo got confused half way through when I realized that at some point this file started to contain more then just tope level components, which was initial intent. I conceptually this PR is ready for initial feedback but I need to clean it up to only contain top level components and it's types.
@aklkv some HDS sub-components are used in the consumers' code, so we can't export only the top-level ones (that's why we have them in the file). See one example of many here: https://github.com/hashicorp/cloud-ui/blob/main/engines/waypoint/addon/components/preview-pane.hbs
/cc @alex-ju
@didoo I would need your help to identify which contextual component you know for a fact that would be consumed as template imports world directly. Or an other option is we keep everything exposed
@didoo I would need your help to identify which contextual component you know for a fact that would be consumed as template imports world directly. Or an other option is we keep everything exposed
I think this is something that was in the TODO list for @alex-ju. Alex can you help @aklkv here? Thanks
@didoo I would need your help to identify which contextual component you know for a fact that would be consumed as template imports world directly. Or an other option is we keep everything exposed
I think this is something that was in the TODO list for @alex-ju. Alex can you help @aklkv here? Thanks
@aklkv's suggestion looks good! I see that you preserved subcomponents where added. I'm not sure we have an exhausted list as of now, so the best start is to preserve what we have (which you've already done, it seems).
@aklkv I've updated a bit the code by re-organizing the imports/exports and adding the missing sub-components (practically every sub-component is public, since it's documented).
@aklkv don't forget to add a changeset to the PR