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

chore: Reduce duplicated styles on button component #3254

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

avinashbot
Copy link
Member

@avinashbot avinashbot commented Feb 5, 2025

Description

Created to "unblock" #3253. We're at the edge of a couple of the bundle size checks, and adding a new button variant pushed it over the edge. Taking a look at the CSS, I realized we were looping through and generating a chunk of CSS for each button variant, but a lot of it wasn't variant-dependent, so it didn't really belong in that for loop.

Just like that! A lot of pointless CSS removed (though with no particular user impact since I imagine it could easily be gzipped away)

  lib/components/internal/plugins/index.js
  Size limit: 14 kB
  Size:       13.79 kB with all dependencies and minified
  
  lib/components/internal/widget-exports.js
- Size limit: 800 kB
- Size:       796.35 kB with all dependencies and minified
+ Size limit: 750 kB
+ Size:       745 kB with all dependencies and minified

How has this been tested?

Will run it in my pipeline to make sure the selector order changes didn't mess anything up visually. But it seems reasonable enough to have a reviewer assigned in the meantime.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.44%. Comparing base (f8a00dd) to head (b03fdec).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3254    +/-   ##
========================================
  Coverage   96.44%   96.44%            
========================================
  Files         791      791            
  Lines       22568    22568            
  Branches     7385     7793   +408     
========================================
  Hits        21765    21765            
+ Misses        796      750    -46     
- Partials        7       53    +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@avinashbot avinashbot marked this pull request as ready for review February 5, 2025 17:24
@avinashbot avinashbot requested a review from a team as a code owner February 5, 2025 17:24
@avinashbot avinashbot requested review from Al-Dani and removed request for a team February 5, 2025 17:24
Copy link
Member

@just-boris just-boris left a comment

Choose a reason for hiding this comment

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

❤️

@avinashbot avinashbot added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit 0905da2 Feb 6, 2025
41 checks passed
@avinashbot avinashbot deleted the reduce-button-css branch February 6, 2025 11:09
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.

3 participants