[code-infra] Port codebase to use tsgo#48616
Merged
Merged
Conversation
Deploy previewhttps://deploy-preview-48616--material-ui.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the repository’s TypeScript type-checking/build scripts from tsc to tsgo (via TypeScript native preview) to align the codebase with the new compiler/tooling flow managed by code-infra.
Changes:
- Switched many workspace
typescriptscripts (and module augmentation checks) fromtsctotsgo. - Updated
code-infra buildinvocations to use--tsgowhere applicable. - Added
@typescript/native-previewto the root devDependencies and updatedpnpm-lock.yamlaccordingly, plus adjusted a few TS directive comment placements in type tests.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/package.json | Switches test workspace typecheck script to tsgo. |
| pnpm-lock.yaml | Locks new @typescript/native-preview dependency graph and peer optional wiring. |
| packages/mui-utils/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-types/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-system/src/styled/styled.spec.ts | Adjusts @ts-expect-error placement in a styled variants type test. |
| packages/mui-system/scripts/testModuleAugmentation.js | Runs module augmentation checks with tsgo instead of tsc. |
| packages/mui-system/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-stylis-plugin-rtl/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-styled-engine/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-styled-engine-sc/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-private-theming/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-material/test/typescript/OverridableComponent.spec.tsx | Moves @ts-expect-error directives within JSX attribute tests (one placement needs correction). |
| packages/mui-material/src/styles/styled.spec.tsx | Adjusts @ts-expect-error placement for a styled variants misuse test. |
| packages/mui-material/src/CardHeader/CardHeader.spec.tsx | Refines @ts-expect-error placements inside slotProps typing tests. |
| packages/mui-material/scripts/testModuleAugmentation.js | Runs module augmentation checks with tsgo instead of tsc. |
| packages/mui-material/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-material-pigment-css/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-material-nextjs/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-lab/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages/mui-icons-material/package.json | Switches typescript script to tsgo. |
| packages-internal/scripts/package.json | Switches typescript typecheck script from tsc to tsgo. |
| packages-internal/docs-utils/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages-internal/core-docs/src/AppLayout/navigation/AppNavDrawerItem.tsx | Moves a TS ignore directive into the JSX props list. |
| packages-internal/core-docs/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages-internal/api-docs-builder/package.json | Uses code-infra build --tsgo and switches typescript script to tsgo. |
| packages-internal/api-docs-builder-core/package.json | Switches typescript script to tsgo. |
| package.json | Adds @typescript/native-preview devDependency to provide tsgo. |
| docs/package.json | Switches docs typecheck scripts to tsgo. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9075108 to
1508343
Compare
f42b302 to
eed6c99
Compare
Janpot
approved these changes
Jun 5, 2026
Janpot
left a comment
Member
There was a problem hiding this comment.
Not 100% sure all the // @ts-expect-error are equivalent, but seems fine. We should add a lint rule that makes an explanation mandatory on each // @ts-expect-error
593aacf to
1f92d6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tsgo migration —
test_typesCI: summaryRoot cause: tsgo is native Go, so the old
--max-old-space-size=3072cap is a no-op. Thedocstypecheck needs ~7.8 GB under tsgo (vs ~3 GB under tsc), overflowing the 6 GB box.GOMEMLIMITcan't help (live memory, not garbage). Only xlarge.gen2 (16 GB) fits.Fix:
test_types+test_types_next→resource_class: xlarge.gen2; removed deadNODE_OPTIONS. Concurrency stays 2.Result: green, peak 11.2 GB / 16 GB (4.8 GB headroom) → 3.9× faster, ~32% cheaper.