Skip to content
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

USWDS - Core: Remove unused dependencies #5832

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Mar 22, 2024

Summary

Removed many unused development dependencies.

Breaking change

This is not a breaking change.

Problem statement

USWDS should minimize its use of dependencies and eliminate unused dependencies in order to improve maintainability of remaining dependencies and to reduce attack surface area for supply chain attacks.

Solution

Removes unused dependencies after analysis.

Analysis:

Testing and review

Verify build passes and Storybook local development is unaffected.

Dependency updates

Dependency name Previous version New version
babel-loader [9.1.3] --
gulp-changed [4.0.3] --
gulp-clean [0.4.0] --
gulp-cli [2.3.0] --
normalize.css [8.0.1] --
path [0.12.7] --
react-dom [17.0.2] --
twig-html-loader [0.1.9] --

@amyleadem amyleadem requested review from mahoneycm, mejiaj and amyleadem and removed request for mahoneycm April 22, 2024 14:44
@amyleadem amyleadem added the Needs: Discussion We need to discuss an approach to this issue label Apr 29, 2024
@@ -157,16 +153,13 @@
"merge-stream": "2.0.0",
"mocha": "10.2.0",
"mq-polyfill": "1.1.8",
"normalize.css": "8.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the mention of normalize.css here could be updated or removed. It's possible it could be updated to "uswds-elements/lib/normalize", but looking at https://github.com/uswds/uswds/blob/develop/packages/uswds-elements/lib/_normalize.scss, it doesn't look like anything is actually being overridden.

Copy link
Contributor Author

@aduth aduth May 9, 2024

Choose a reason for hiding this comment

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

The appearance: none would still override the -webkit-appearance: textfield from the _normalize.scss stylesheet. I think the comment itself is meant to serve as an explanation for the disabled Stylelint rule, since Stylelint would normally expect a selector of [type="search"], which would have equal specificity to the normalized styles. I think as long as it came after the normalize styles, it would take priority, but maybe it was desired to want to avoid depending on stylesheet order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But yes I would agree with your point that the comment could be updated to reference USWDS's internal normalization stylesheet rather than normalize.css, which is not used directly.

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this!

I can confirm builds and local storybookJS are unaffected

@mejiaj mejiaj added this to the uswds 3.9.0 milestone May 21, 2024
@mejiaj mejiaj added Affects: Dependencies Relates to project dependencies and removed Needs: Discussion We need to discuss an approach to this issue labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Dependencies Relates to project dependencies
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

None yet

5 participants