Skip to content

[core] Use @typescript/typescript6 for the docs tooling - #49025

Merged
Janpot merged 2 commits into
mui:masterfrom
Janpot:code-infra/ts7-compiler-api
Aug 25, 2026
Merged

[core] Use @typescript/typescript6 for the docs tooling#49025
Janpot merged 2 commits into
mui:masterfrom
Janpot:code-infra/ts7-compiler-api

Conversation

@Janpot

@Janpot Janpot commented Aug 24, 2026

Copy link
Copy Markdown
Member

TypeScript 7.0 is stable (typescript@latest is 7.0.2) but deliberately ships no importable compiler API — the package root exports only version, and the replacement is still behind typescript/unstable/*. api-docs-builder, docs-utils and typescript-to-proptypes all build on ts.Program/ts.TypeChecker, so the nightly test_types_next job fails with 128 errors before it reaches the public typings. It has been red every night for 30 days. There is nothing to migrate to yet: typescript-eslint, ts-morph and the Vue/Svelte/Angular tooling are all in the same position, and Microsoft publishes @typescript/typescript6 for exactly this.

So these three depend on @typescript/typescript6 by name — the constraint sits in the packages that have it rather than in a workspace-wide override, the typescript@next override can't reach them, and nothing silently holds them back when the repo moves its own typescript to 7.x. typescript is no longer imported in them and drops from their dependencies (tsgo comes from @typescript/native-preview). TypeScript 7.1 plans to stabilise the API (microsoft/TypeScript#63703, stable planned 2026-11-10), which is when this gets swapped back.

Verified with typescript@7.1.0-dev installed over the workspace: all three job steps pass. On a normal install typescript:ci is green, the 67 typescript-to-proptypes tests pass, and pnpm proptypes + pnpm docs:api:build regenerate byte-identical output.

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-49025--material-ui.netlify.app/
QR code for https://deploy-preview-49025--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 Aug 24, 2026
@Janpot Janpot changed the title [core] Pin docs tooling to TypeScript 6.x [core] Use @typescript/typescript6 for the docs tooling Aug 24, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 24, 2026
Janpot added 2 commits August 24, 2026 16:17
TypeScript 7 removed the JS compiler API from the `typescript` package root:
`lib/` now ships only `tsc.js`, `version.cjs` and `getExePath`, and the root
export points at `lib/version.cjs`. The replacement API sits behind the
unstable `typescript/unstable/*` subpaths and is not source compatible.

`api-docs-builder`, `docs-utils` and `scripts/typescript-to-proptypes` all
build on `ts.Program`/`ts.TypeChecker`, so the nightly `test_types_next` job
— which installs typescript@next across the workspace — fails with 128
errors before it ever checks the public typings. It has been red every night
for the last 30 days.

Scope the tooling packages to 6.x so the canary keeps exercising what it is
meant to exercise. They already declare `^6.0.3`/`^5.9.3 || ^6.0.0`, so this
only stops the workspace-wide override from reaching them. Porting them to
the new API stays a separate piece of work.
Replaces the workspace-wide pnpm override with a direct dependency, so the
constraint lives in the three packages that actually have it rather than
applying to the whole repo whether or not `set-version-overrides` ran.

TypeScript 7.0 is stable but deliberately ships no importable compiler API:
the package root exports only `version` and the replacement is still behind
`typescript/unstable/*`. Everything consuming `ts.Program`/`ts.TypeChecker`
is in the same position, and Microsoft publishes `@typescript/typescript6`
for it. Depending on it by name means the `typescript` override cannot
reach these packages, and it stops the pin from silently holding them back
when the repo moves its own `typescript` to 7.x.

`typescript` itself is no longer imported anywhere in these packages, so it
goes from their dependencies; `tsgo` comes from `@typescript/native-preview`
and is unaffected.

TypeScript 7.1 plans to stabilise the API (microsoft/TypeScript#63703),
which is when this can be swapped back.
@Janpot
Janpot force-pushed the code-infra/ts7-compiler-api branch from c51ea3b to 3b9e325 Compare August 24, 2026 14:21
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 24, 2026
@Janpot
Janpot requested a review from a team August 24, 2026 17:41
@Janpot
Janpot marked this pull request as ready for review August 24, 2026 17:41
@Janpot

Janpot commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Flaky screenshot fixed by #49028

@Janpot
Janpot merged commit 145853f into mui:master Aug 25, 2026
17 of 18 checks passed
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