Repository navigation
[core] Document and test the TypeScript 5 support policy - #49323
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
There was a problem hiding this comment.
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.
michelengelen
left a comment
There was a problem hiding this comment.
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?
|
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. |
| 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. |
|
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? |
|
Cherry-pick PRs will be created targeting branches: v9.x |
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:
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, andbundlerresolution. 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_minimumjob in bothnightlyandnightly-cron. Its normal lockfile installation preserves the consumer compiler independently of thetypescript@nextjob. 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:
Follow-up to #49247.