Skip to content

chore(deps): update css-loader, remove redundant deps #7739

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

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

Conversation

avivkeller
Copy link
Member

Ref: #7725

This PR does two things:

  1. It updates css-loader to the next major
  2. It removes postcss dependencies that are bundled with Next.js, since they do not serve a purpose

@Copilot Copilot AI review requested due to automatic review settings May 10, 2025 15:14
@avivkeller avivkeller requested a review from a team as a code owner May 10, 2025 15:14
Copy link

vercel bot commented May 10, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 10, 2025 3:15pm

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

This PR updates the version of css-loader to its next major release and removes redundant postcss-related dependencies that are bundled with Next.js.

  • Updated css-loader version in packages/ui-components/package.json
  • Adjusted Storybook configuration in packages/ui-components/.storybook/main.ts to match the new css-loader settings and removed explicit postcss-loader configuration
  • Removed unneeded postcss and postcss-loader entries from apps/site/package.json

Reviewed Changes

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

File Description
packages/ui-components/package.json Upgraded css-loader dependency to ~7.1.2
packages/ui-components/.storybook/main.ts Updated css-loader options and simplified postcss-loader configuration
apps/site/package.json Removed redundant postcss dependencies bundled with Next.js
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/ui-components/.storybook/main.ts:27

  • The removal of the custom implementation for 'postcss-loader' (previously using require.resolve('postcss')) means the default configuration will be used. Please confirm that these defaults align with your intended postcss behavior within Storybook.
options: { esModule: false, importLoaders: 1, },

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.84%. Comparing base (10a07a1) to head (3a1e31a).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7739   +/-   ##
=======================================
  Coverage   74.84%   74.84%           
=======================================
  Files          98       98           
  Lines        7888     7888           
  Branches      200      200           
=======================================
  Hits         5904     5904           
  Misses       1983     1983           
  Partials        1        1           

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented May 10, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@@ -55,9 +55,7 @@
"next": "15.3.1",
"next-intl": "~4.1.0",
"next-themes": "~0.4.6",
"postcss": "~8.5.3",
Copy link
Member

Choose a reason for hiding this comment

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

It's strange to remove it because tailwind guide ask it

Copy link
Member Author

Choose a reason for hiding this comment

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

Next.js includes PostCSS bundled with it

Copy link
Member

Choose a reason for hiding this comment

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

They both recommended to install postcss so I'm not sure if it's good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

Per https://nextjs.org/docs/pages/guides/post-css

Next.js compiles CSS for its built-in CSS support using PostCSS.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm strange, let's wait for the opinion of other team members

Copy link
Member

Choose a reason for hiding this comment

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

It may vary, the guide that @avivkeller shared is for the Pages Router, but we use both the App Router and the Pages Router, so it's hard to know exactly what should be done. Maybe asking for input from someone on the Next.js team would be a good idea

Copy link
Member Author

@avivkeller avivkeller May 10, 2025

Choose a reason for hiding this comment

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

It's also worth nothing that postcss is a dependency of Next.js itself, regardless of what router is used.

To be honest, I'm not strong one way or another, this doesn't change our dependency count down the line (since postcss is still installed by Next)

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