Skip to content

feat(ui): minify css #7988

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 2 commits into from
Jul 17, 2025
Merged

feat(ui): minify css #7988

merged 2 commits into from
Jul 17, 2025

Conversation

avivkeller
Copy link
Member

Fixes #7982 by cssnano-ing the styles prepublish.

(Also pnpm i sorted the package.json)

@Copilot Copilot AI review requested due to automatic review settings July 16, 2025 00:29
@avivkeller avivkeller requested review from a team as code owners July 16, 2025 00:29
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jul 16, 2025 1:24am

Copy link
Contributor

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

Pull Request Overview

Adds CSS minification to the UI components package by integrating cssnano into the build process and updating the dependency list.

  • Introduce cssnano in devDependencies and PostCSS config
  • Reorder and sort devDependencies in package.json after running pnpm install

Reviewed Changes

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

File Description
packages/ui-components/package.json Added cssnano to devDependencies and sorted entries
packages/ui-components/.postcssrc.json Included cssnano plugin for CSS post-processing
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/ui-components/.postcssrc.json:5

  • [nitpick] Consider configuring cssnano to only run in production builds (e.g., via an environment-specific PostCSS config) to avoid unnecessary minification overhead during development.
    "cssnano": {}

Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.12%. Comparing base (b035290) to head (43cb8d6).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7988      +/-   ##
==========================================
+ Coverage   73.10%   73.12%   +0.02%     
==========================================
  Files          95       95              
  Lines        8355     8354       -1     
  Branches      219      218       -1     
==========================================
+ Hits         6108     6109       +1     
+ Misses       2246     2244       -2     
  Partials        1        1              

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

@MattIPv4
Copy link
Member

MattIPv4 commented Jul 16, 2025

I should ask though, why isn't Tailwind doing this for us? It appears to have support for optimization + minification: https://github.com/tailwindlabs/tailwindcss/blob/88b9f15b65588a87c5b6b13316530b4aecbc1b0b/packages/%40tailwindcss-postcss/src/index.ts#L55 (appears to use lightningcss: https://github.com/tailwindlabs/tailwindcss/blob/main/packages/%40tailwindcss-node/src/optimize.ts)

@avivkeller
Copy link
Member Author

I didn't know that was supported on PostCSS, the docs say to use cssnano. I've tested it, and it works, committing now

@MattIPv4
Copy link
Member

Those are v3 docs ;)

@avivkeller avivkeller added this pull request to the merge queue Jul 17, 2025
Merged via the queue into main with commit a008bed Jul 17, 2025
16 of 18 checks passed
@avivkeller avivkeller deleted the ui/prepublish/minify-css branch July 17, 2025 17:38
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.

Published styles of ui-components should be minified
6 participants