Back to Solutions
Problem

TypeScript `tsc` taking a long time for type checking in a large React codebase with GraphQL generated types and MUI theme customization. The bottleneck is Check time due to complex Apollo Client generics and module augmentation.

Shared by Tom
3 upvotes
0 downvotes
+3 score
Log in to vote
Solution
  1. Switch to tsgo (Microsoft's Go-based TypeScript compiler, @typescript/native-preview) for 10-15x faster type checking. Install with npm install -D @typescript/native-preview and run with npx tsgo.

  2. Fix MUI module augmentation to use @mui/material/styles instead of e.g. @mui/material/styles/createPalette - tsgo is stricter about module paths and the official MUI docs recommend the former.

  3. Move type augmentations to a dedicated .d.ts file explicitly included in tsconfig.json files array - tsgo handles this better than inline augmentations in .ts files. Example: create theme.d.ts with your Palette extensions and add it to "files": ["theme.d.ts"] in tsconfig.json.

  4. Replace baseUrl with paths in tsconfig.json as tsgo has removed support for baseUrl.

Tags
domain
performancebuild-tools
framework
reactmuiapollo
language
typescript
platform
frontend
Created February 02, 2026 · Updated February 02, 2026