Skip to content

[code-infra] Import React as a type where only types use it - #24376

Closed
Janpot wants to merge 2 commits into
mui:masterfrom
Janpot:code-infra/type-only-react-imports
Closed

Janpot wants to merge 2 commits into
mui:masterfrom
Janpot:code-infra/type-only-react-imports

Conversation

@Janpot

@Janpot Janpot commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

typescript-eslint 8.74 reports @typescript-eslint/consistent-type-imports on import * as React from 'react' when React is only used in types. That fails test_lint on the infra bump in #24311 with 125 errors.

These are the eslint --fix results, one line per file: import type * as React from 'react'. They lint clean on 8.74 and pnpm typescript passes. import type is also fine under master's 8.73, so this can land before the bump.

@code-infra-dashboard

code-infra-dashboard Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-24376--material-ui-x.netlify.app/
QR code for https://deploy-preview-24376--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

Performance

No regressions in 38 benchmarks · precise to ±13.1% (±59.2% at worst) · ran 7m 44s · details


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

@Janpot Janpot 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 Dec 2, 2026
@Janpot Janpot closed this Dec 2, 2026
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.

1 participant