Skip to content

[core] Document and test the TypeScript 5 support policy - #49323

Merged
LukasTy merged 4 commits into
mui:masterfrom
LukasTy:codex/typescript-minimum-docs
Oct 15, 2026
Merged

LukasTy merged 4 commits into
mui:masterfrom
LukasTy:codex/typescript-minimum-docs

Conversation

@LukasTy

@LukasTy LukasTy commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

The docs still list TypeScript 4.9 and a two-year support window, while Material UI's published declarations already use syntax introduced in TypeScript 5. Update both documentation pages to state the agreed support policy:

Material UI supports TypeScript 5 and later.

Add a consumer fixture pinned to TypeScript 5.9.3, the latest stable 5.x release verified from the npm registry on October 15, 2026. It checks built declarations through root and subpath imports with node, node16, and bundler resolution. Node16 covers CommonJS and ESM consumers. Library checking stays enabled, and the fixture has no source aliases.

The fixture runs after the public package build in a dedicated test_types_minimum job in both nightly and nightly-cron. Its normal lockfile installation preserves the consumer compiler independently of the typescript@next job. Development compiler versions stay unchanged.

Renovate can update this fixture to newer stable minor and patch releases within major 5, using a file-scoped allowedVersions: ">=5.0.0 <6.0.0" rule. Moving the fixture to a newer major requires an explicit support-policy change.

Validation:

  • Fresh public package build and all three TypeScript 5.9.3 consumer checks passed.
  • Renovate configuration passed its official JSON schema; version-range checks allow 5.x updates and reject other majors.
  • Verified the lockfile changes only the fixture compiler; frozen-lockfile installation passed.
  • ESLint, Prettier, Vale for the three Markdown files, and diff checks passed.
  • The nightly workflow has not been run remotely for this update.

Follow-up to #49247.

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 6, 2026 •

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 docs Improvements or additions to the documentation. 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. needs cherry-pick The PR should be cherry-picked to master after merge. v9.x labels Oct 6, 2026
@LukasTy LukasTy self-assigned this Oct 6, 2026

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

🟢 Approval recommended

The documentation, fixture, dependency pinning, and nightly integration consistently enforce the intended TypeScript 5.0 compatibility boundary.

Review effort: Balanced
Findings: None

What changed in this PR

Updates the documented TypeScript minimum to 5.0 and adds CI coverage against TypeScript 5.0.4.

Changes:

  • Updates both compatibility guides.
  • Adds built-declaration tests across supported module-resolution modes.
  • Runs the guard in nightly workflows and prevents Renovate updates.
File Description
.circleci/​config.yml Adds the nightly minimum-version job.
docs/​data/​material/​getting-started/​supported-platforms/​supported-platforms.md Documents TypeScript 5.0 minimum.
docs/​data/​material/​guides/​typescript/​typescript.md Updates the TypeScript guide minimum.
pnpm-lock.yaml Locks fixture dependencies.
renovate.json Protects the TypeScript pin.
test/​typescriptMinimum/​README.md Documents the compatibility test.
test/​typescriptMinimum/​package.json Defines compiler modes and dependencies.
test/​typescriptMinimum/​src/​Test.tsx Tests CommonJS consumer imports and types.
test/​typescriptMinimum/​src/​esm.mts Tests ESM consumer imports.
test/​typescriptMinimum/​tsconfig.json Configures strict declaration checking.
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.

@LukasTy
LukasTy marked this pull request as ready for review October 6, 2026 14:45

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

LGTM ... the only thing I have is a question: Why do we not increase the version to 6.x? Is there benefit on staying on 5 or is it simply because we don't want to jump 2 versions at once to decrease the pain points user might have?

@Janpot

Janpot commented Oct 13, 2026

Copy link
Copy Markdown
Member

As per Slack discussion, would it make sense to only mention a major version as minimum? We shouldn't have to support every 5.x version, just the last released one.

@LukasTy LukasTy changed the title [core] Document and test the TypeScript 5.0 minimum [core] Document and test the TypeScript 5 support policy Oct 15, 2026
Material UI requires a minimum version of TypeScript 5.0.
This aims to match the policy of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped), with the support of the versions of TypeScript that are less than two years old.
Material UI supports TypeScript 5 and later.
Only the latest minor and patch release of each supported major version is supported.

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 wouldn't even mention it 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sneaky. 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done: be9c9a6

@LukasTy

LukasTy commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

Thanks for the feedback! I’ve updated the PR to follow Jan’s suggestion.

The earlier audit found no technical requirement for TypeScript 6 in Material UI’s declarations. Keeping 5 as the oldest supported major lets consumers stay on 5.

The docs now explicitly state that Material UI supports TypeScript 5 and later, with support limited to the latest minor and patch release of each supported major. I also removed the previous reference to DefinitelyTyped’s two-year support window so the policy is consistent.

The nightly consumer fixture now uses TypeScript 5.9.3, the latest stable 5.x release verified from the registry. Renovate can update it within major 5, while moving to a newer major remains an explicit support-policy decision.

Could you take another look and confirm that the wording matches the intended policy?
Or should we be even less specific and/or strict?

@LukasTy
LukasTy enabled auto-merge (squash) October 15, 2026 08:35
@LukasTy
LukasTy disabled auto-merge October 15, 2026 08:43
@LukasTy
LukasTy merged commit 03536da into mui:master Oct 15, 2026
22 checks passed
@LukasTy
LukasTy deleted the codex/typescript-minimum-docs branch October 15, 2026 08:43
@github-actions

Copy link
Copy Markdown
Contributor

Cherry-pick PRs will be created targeting branches: v9.x

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

Labels

docs Improvements or additions to the documentation. 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.

4 participants