Skip to content

refactor: Clean up USWDS directory and imports #1592

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

Merged
merged 4 commits into from
Apr 15, 2025

Conversation

AliceR
Copy link
Member

@AliceR AliceR commented Apr 7, 2025

Related Ticket: no ticket

Description of Changes

As part of a bigger cleanup initiative I would like to propose that we move the /uswds directory outside of the current components/common/... structure. This is essentially just a renaming of files, and updating the imports that were not previously referencing the $uswds alias. The reason bring just general cleanup and better separation.

Notes & Questions About Changes

There should be no changes to any rendering or build processes! It is just an organizational change.

💖 For easier review, please inspect the changes commit by commit!!

Validation / Testing

  • Validate that the change does not affect development nor build of the library!

@AliceR AliceR requested review from sandrahoang686 and Copilot April 7, 2025 11:05
Copy link

netlify bot commented Apr 7, 2025

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 68af9b0
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67f7a44be34d7d00086a3f39
😎 Deploy Preview https://deploy-preview-1592--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 41 out of 41 changed files in this pull request and generated no comments.

for consistency and better overview
@vgeorge
Copy link
Contributor

vgeorge commented Apr 9, 2025

@AliceR This was not introduced in this PR, but I'm curious about why do we need to rename components from USWDS instead of just using the directly. In the uswds folder all the components are just passing props to a prefixed USWDS* component.

Copy link
Collaborator

@sandrahoang686 sandrahoang686 left a comment

Choose a reason for hiding this comment

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

I'm fine with this and have no strong opinions on if we move the uswds dir outside of the common dir. But I did tag @hanbyul-here too in case she might have a stronger opinion.

@hanbyul-here
Copy link
Collaborator

hanbyul-here commented Apr 10, 2025

@vgeorge - If I remember correctly (please correct me if I am wrong) , the initial intention of having mid-layer was that even if we change the library in the future again, the end component doesn't have to change import syntax. If we look at the current context, let's say we want to change Button (which is from ui library), if the Button was encapsulated in the separate file, we can do whatever prop change in that midlayer and pass it to the component from the new library. The initial thought is documented in this PR: #1031 (comment)

@AliceR Since it is a PR that mainly changes the paths, I am guessing what you are looking for from review is an opinion . It seems a bit difficult to form an opinion on cleaning for me. Can you list more of the benefits we can get from this folder structure? What is the bigger initiative that we should foresee from this change?

@AliceR
Copy link
Member Author

AliceR commented Apr 10, 2025

@hanbyul-here Thanks for the question! The reason for moving the uswds folder is to better organize our project and improve maintainability. Right now, it’s mixed with legacy files and newer components, making it harder to navigate and find the right pieces. By separating it out, we clarify the distinction between apples and oranges, which improves discoverability and reduces cognitive load.

This is just a small first step—future changes will include auditing legacy files, refining the folder structure, and potentially documenting conventions for better consistency moving forward.

Happy to discuss further if needed!

@vgeorge vgeorge self-requested a review April 15, 2025 12:38
@AliceR AliceR merged commit ec237e2 into main Apr 15, 2025
10 checks passed
@AliceR AliceR deleted the refactor/cleanup-uswds-imports branch April 15, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants