Type-checking a TypeScript codebase can be slow, especially for monorepos containing lots of projects that each need to use the type checker to generate type declaration files. In this talk, we introduce — for the very first time — a new TypeScript feature we are working on called “Isolated Declarations” that allows DTS files to be generated without using the type checker at all! This opens the door to faster declaration generation in TypeScript itself, as well as in external tools written in other languages such as ESBuild and swc. You'll see how to use this new option, and maybe (just maybe) you’ll be convinced about the benefits of explicit return types! Most importantly, we will show how Isolated Declarations enables parallel builds to spread work across your CPU cores to significantly improve the build speed of your TypeScript projects.
Faster TypeScript builds with --isolatedDeclarations
AI Generated Video Summary
This Talk discusses the optimization of build performance in TypeScript, particularly in monorepos. The speaker explores the idea of running the compiler in parallel to take advantage of multi-core hardware, but faces limitations due to dependencies. They propose using isolated modules to increase parallelism and optimize build performance. The addition of isolated declarations improves performance by synthesizing new types and increasing declaration limit speed. The future of this feature in TypeScript looks promising, with potential for further improvements and collaboration with other tools.

















Comments