Skip to content

[core] Raise the minimum supported TypeScript version to 5.0 - #49247

Closed
LukasTy wants to merge 1 commit into
mui:masterfrom
LukasTy:codex/typescript-minimum-5
Closed

LukasTy wants to merge 1 commit into
mui:masterfrom
LukasTy:codex/typescript-minimum-5

Conversation

@LukasTy

@LukasTy LukasTy commented Sep 30, 2026

Copy link
Copy Markdown
Member

Raise Material UI's supported TypeScript minimum from 4.9 to 5.0, as requested in the separate tracking discussion. TypeScript 4.9 users must upgrade their compiler. The development compiler versions stay unchanged.

Add a consumer test pinned to TypeScript 5.0.4. It checks built createTheme, Button, and Menu declarations with node, node16, and bundler resolution. It has no source aliases and keeps library checking enabled. Run it after the public package build in CI, and prevent Renovate from changing the minimum compiler pin.

Validation passed:

  • pnpm release:build and both built-declaration validators.
  • The new minimum-version test and the existing module-resolution tests.
  • pnpm typescript: all 19 projects.
  • pnpm test:unit run: 739 files and 13,178 tests passed; 9 files and 1,091 tests skipped.
  • ESLint, Prettier, Vale error checks, and frozen-lockfile installation.

Compiler traces confirmed that all 547 MUI declaration inputs came from build folders for both CommonJS and ESM. A temporary TypeScript 5.4-only type in a built declaration caused the new guard to fail as expected.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 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 typescript type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Sep 30, 2026
@LukasTy

LukasTy commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

PR review

No findings. No merge-blocking issues identified.

Validation for PR #49247 at e6636c4b:

  • TypeScript 5.0.4 checks passed for node, node16, and bundler.
  • Existing module-resolution tests passed.
  • Each mode loaded 547 MUI declarations exclusively from build folders and correctly rejected an in-memory newer-only type.

Validation used existing build outputs. Node16 ESM-specific resolution is not directly covered.

Copied the findings and validation summary to your clipboard.

Verdict

Approve — no actionable correctness, test, simplification, or documentation issues found.


🤖 Review generated with Codex

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.

Copilot review overview

🟡 Changes recommended

The documented TypeScript floor contradicts the immediately stated two-year support policy.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Raises Material UI’s TypeScript minimum to 5.0 and adds CI validation against built declarations.

Changes:

  • Updates TypeScript support documentation.
  • Adds a TypeScript 5.0.4 consumer test across three resolution modes.
  • Integrates the test into CI and excludes its compiler pin from Renovate.
File Description
test/​typescriptMinimum/​tsconfig.json Configures strict declaration validation.
test/​typescriptMinimum/​src/​Test.tsx Exercises representative Material UI APIs.
test/​typescriptMinimum/​README.md Documents the test workflow.
test/​typescriptMinimum/​package.json Pins dependencies and defines test commands.
renovate.json Protects the minimum compiler pin.
pnpm-lock.yaml Locks the new test workspace dependencies.
docs/​data/​material/​guides/​typescript/​typescript.md Documents TypeScript 5.0 as the minimum.
docs/​data/​material/​getting-started/​supported-platforms/​supported-platforms.md Updates the supported-platform requirement.
.circleci/​config.yml Runs the new test after package builds.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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

## TypeScript

Material UI requires a minimum version of TypeScript 4.9.
Material UI requires a minimum version of TypeScript 5.0.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think Copilot has a valid point here.

@LukasTy
LukasTy marked this pull request as ready for review September 30, 2026 09:03
@LukasTy LukasTy self-assigned this Sep 30, 2026
@LukasTy
LukasTy requested review from a team, Janpot and siriwatknp September 30, 2026 09:04
@Janpot

Janpot commented Sep 30, 2026

Copy link
Copy Markdown
Member

Out of curiosity, which 5.0 features are we relying on that 4.9 doesn't accept?

@LukasTy

LukasTy commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Out of curiosity, which 5.0 features are we relying on that 4.9 doesn't accept?

Base UI declarations with const type parameters.

@LukasTy LukasTy added needs cherry-pick The PR should be cherry-picked to master after merge. v9.x labels Sep 30, 2026

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we okay shipping breaking changes as part of v9?

@LukasTy

LukasTy commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Closing as we agreed internally on a different solution that would avoid the slight BC on the v9.x version.

@LukasTy LukasTy closed this Sep 30, 2026
@LukasTy
LukasTy deleted the codex/typescript-minimum-5 branch September 30, 2026 10:30
@mnajdova

Copy link
Copy Markdown
Member

@LukasTy we can still leave the PR open, just remove the cherry-pick label. For future reference the decision was:

  • In v10, we align the minimum versions for Material UI and Base UI - so no patches or fixes like this would be needed
  • In v9, we add a different path for the theme augmentation and export the new Menu component as "unstable" until v10, as we want to give some time for the component to mature till the next major before shipping it as stable

@LukasTy

LukasTy commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

We'll refine the needed minimum version and can open a new PR.
Going with the preference of avoiding stale, open pending PRs that sit around. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. typescript v9.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants