USWDS - Core: Remove commented code from utility builder#5209
Merged
thisisdano merged 1 commit intoMay 8, 2023
Conversation
mejiaj
approved these changes
Apr 7, 2023
mejiaj
left a comment
Contributor
There was a problem hiding this comment.
Makes sense to remove them if we're not using. Thanks!
2 tasks
amyleadem
approved these changes
Apr 7, 2023
amyleadem
left a comment
Contributor
There was a problem hiding this comment.
This feels safe to remove. The render-media-queries mixin no longer exists in the code base, and this code block was commented out 3 years ago.
mahoneycm
approved these changes
Apr 7, 2023
mahoneycm
left a comment
Contributor
There was a problem hiding this comment.
I saw a major reduction in the file size of the project 👍
thisisdano
approved these changes
May 8, 2023
thisisdano
left a comment
Contributor
There was a problem hiding this comment.
Little change, big effect
This was referenced May 31, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduce size of compiled CSS when comments aren't explicitly excluded.
Problem statement
When compiling USWDS without optimization configured to remove comments, the output includes 1500 instances of the following snippet of code (one for each utility class):
This unnecessarily inflates the size of the compiled output, and may cause extra work for the compilation itself.
Solution
Remove unused code.
Testing and review
Before: 1336223 bytes (1336.2kb)
After: 657293 bytes (657.3kb)
Diff: 678930 bytes (-50.8%)