Skip to content

[code-infra] Make @mui/internal-docs-utils compatible with TypeScript 6#48594

Draft
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:code-infra/docs-utils-ts6-peer-dep
Draft

[code-infra] Make @mui/internal-docs-utils compatible with TypeScript 6#48594
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:code-infra/docs-utils-ts6-peer-dep

Conversation

@Janpot
Copy link
Copy Markdown
Member

@Janpot Janpot commented May 29, 2026

Summary

Makes @mui/internal-docs-utils compatible with TypeScript 6 ahead of the repo-wide TS 6 upgrade.

The package re-exports the TypeScript compiler API types (ts.Symbol, ts.Type, ts.Program, ts.Node) in its public API and operates on AST nodes its consumers create. So it must share a single typescript instance with whoever consumes it — a bundled dependencies copy invites duplicate-typescript type incompatibilities and SyntaxKind enum mismatches.

  • Move typescript from dependencies to peerDependencies with range ^5.9.3 || ^6.0.0 (admits TS 6 while keeping 5.9 working).
  • Add a pinned typescript devDependency (5.9.3) so the package still typechecks/builds standalone.

The previous ^5.9.3 direct dependency excluded 6.x, which would have caused pnpm to resolve a separate typescript@5.9.3 for this package — silently keeping its typecheck on 5.9 and creating a version mismatch for consumers on TS 6.

The source itself required no changes: it already typechecks and emits declarations cleanly against typescript@6.0.0-dev (verified locally).

Downstream note

This is a published package also consumed by mui-x. Moving typescript to peerDependencies is a (minor) change to the published dependency contract, but both in-repo consumers (api-docs-builder, scripts) and mui-x already depend on typescript, so the peer requirement stays satisfied.

@code-infra-dashboard
Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48594--material-ui.netlify.app/

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.

@Janpot Janpot added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label May 29, 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).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants