Skip to content

[code-infra] Remove the explicit styled-components dependency - #23479

Merged
LukasTy merged 2 commits into
mui:masterfrom
LukasTy:claude/remove-unused-dependency-a405fd
Sep 2, 2026
Merged

LukasTy merged 2 commits into
mui:masterfrom
LukasTy:claude/remove-unused-dependency-a405fd

Conversation

@LukasTy

@LukasTy LukasTy commented Sep 2, 2026

Copy link
Copy Markdown
Member

The docs do not import styled-components anywhere. The package is an optional peer dependency of @mui/internal-core-docs, which uses it in utils/rtlBundle.js (re-exports StyleSheetManager) and in Document/getInitialProps.js (behind setupStyledComponents, which mui-x sets to false).

pnpm has auto-install-peers enabled, so it installs the optional peer and links it into the @mui/internal-core-docs instance. The explicit entry in docs/package.json is redundant.

This also makes #23353 unnecessary.

Verification

After the removal, pnpm install + pnpm dedupe keep styled-components installed as an optional peer of @mui/internal-core-docs:

$ node -p "require.resolve('styled-components', { paths: [coreDocsDir + '/utils'] })"
.../node_modules/.pnpm/styled-components@6.4.4_.../node_modules/styled-components/dist/styled-components.cjs.js
  • pnpm peers check reports no styled-components issue.
  • pnpm dedupe produces no extra changes.
  • pnpm --filter docs typescript passes.

🤖 Generated with Claude Code

The docs never import `styled-components`. The package is an optional peer dependency of `@mui/internal-core-docs`. pnpm installs it through `auto-install-peers`, so the docs still resolve it from the `@mui/internal-core-docs` instance.

This also makes the renovate bump in mui#23353 unnecessary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@code-infra-dashboard

code-infra-dashboard Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23479--material-ui-x.netlify.app/
QR code for https://deploy-preview-23479--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 0B(0.00%) 0B(0.00%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@LukasTy LukasTy added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels Sep 2, 2026
@LukasTy LukasTy changed the title [docs] Remove the explicit styled-components dependency [code-infra] Remove the explicit styled-components dependency Sep 2, 2026
@LukasTy LukasTy mentioned this pull request Sep 2, 2026
1 task
@LukasTy
LukasTy requested review from Janpot and brijeshb42 and a lite review from Copilot September 2, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Dependency cleanup is consistent with the lockfile state and there are no remaining docs imports requiring a direct styled-components dependency.

Pull request overview

Removes the redundant explicit styled-components dependency from the docs app, relying on pnpm’s optional peer installation via @mui/internal-core-docs as intended.

Changes:

  • Removed styled-components from docs/package.json dependencies.
  • Updated pnpm-lock.yaml to reflect the removal from the docs importer while keeping styled-components present as an optional package entry.
File summaries
File Description
docs/package.json Drops the explicit styled-components dependency from the docs app.
pnpm-lock.yaml Removes styled-components from the docs importer and marks the lock snapshot entry as optional.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@LukasTy
LukasTy merged commit 36841e7 into mui:master Sep 2, 2026
22 checks passed
@LukasTy
LukasTy deleted the claude/remove-unused-dependency-a405fd branch September 2, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants