design-system icon indicating copy to clipboard operation
design-system copied to clipboard

feat(components): simplify reexport and add type reexport example

Open aklkv opened this issue 1 year ago • 7 comments

: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.

aklkv avatar Aug 06 '24 04:08 aklkv

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

vercel[bot] avatar Aug 06 '24 04:08 vercel[bot]

@aklkv is still in progress or ready to review?

didoo avatar Aug 06 '24 09:08 didoo

@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 avatar Aug 06 '24 09:08 aklkv

@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 avatar Aug 06 '24 11:08 didoo

@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

aklkv avatar Aug 07 '24 05:08 aklkv

@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 avatar Aug 07 '24 12:08 didoo

@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).

alex-ju avatar Aug 08 '24 09:08 alex-ju

@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).

didoo avatar Sep 04 '24 08:09 didoo

@aklkv don't forget to add a changeset to the PR

didoo avatar Sep 04 '24 15:09 didoo