Skip to content

[code-infra] Port codebase to use tsgo#48616

Open
brijeshb42 wants to merge 1 commit into
mui:masterfrom
brijeshb42:tsgo
Open

[code-infra] Port codebase to use tsgo#48616
brijeshb42 wants to merge 1 commit into
mui:masterfrom
brijeshb42:tsgo

Conversation

@brijeshb42
Copy link
Copy Markdown
Contributor

@brijeshb42 brijeshb42 commented Jun 3, 2026

tsgo migration — test_types CI: summary

Root cause: tsgo is native Go, so the old --max-old-space-size=3072 cap is a no-op. The docs typecheck needs ~7.8 GB under tsgo (vs ~3 GB under tsc), overflowing the 6 GB box. GOMEMLIMIT can't help (live memory, not garbage). Only xlarge.gen2 (16 GB) fits.

Fix: test_types + test_types_nextresource_class: xlarge.gen2; removed dead NODE_OPTIONS. Concurrency stays 2.

Setup Box Time Credits/run vs tsc
tsc (avg from insights) medium+.gen2 8m 33s 153.9
tsgo, conc 1 (1 run) xlarge.gen2 3m 17s 157.6 +2.4%
tsgo, conc 2 (1 run) xlarge.gen2 2m 21s 112.8 −27%
tsgo, conc 3 xlarge.gen2 2m11s ~105 -31.9%
tsgo, conc 4 xlarge.gen2 2m24s ~115 -25.1%

Result: green, peak 11.2 GB / 16 GB (4.8 GB headroom) → 3.9× faster, ~32% cheaper.

@brijeshb42 brijeshb42 added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jun 3, 2026
@brijeshb42 brijeshb42 requested a review from Copilot June 3, 2026 10:21
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Jun 3, 2026

Deploy preview

https://deploy-preview-48616--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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 typescript scripts (and module augmentation checks) from tsc to tsgo.
  • Updated code-infra build invocations to use --tsgo where applicable.
  • Added @typescript/native-preview to the root devDependencies and updated pnpm-lock.yaml accordingly, 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.

Comment on lines 53 to 55
const VariantCallbacksError = styled('div')<{ ownerState: OwnerState } & OwnerState>({
// @ts-expect-error the props callback must return a boolean
font: 'inherit',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The directive change is to support tsgo since that's what the PR aims at.

Comment on lines 112 to 116
<Foo
// @ts-expect-error
component={MyOverrideComponent}
myString={4} // should be a string
numberProp={3}
@brijeshb42 brijeshb42 force-pushed the tsgo branch 12 times, most recently from 9075108 to 1508343 Compare June 3, 2026 13:41
@brijeshb42 brijeshb42 requested a review from a team June 3, 2026 13:56
@brijeshb42 brijeshb42 force-pushed the tsgo branch 5 times, most recently from c831f0c to f42b302 Compare June 3, 2026 16:33
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). typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants