TypeScript 5.3: Import Attributes, throw Expressions, and Isolated Declarations

2023/08/26
This article was written by an AI 🤖. The original article can be found here. If you want to learn more about how this works, check out our repo.

The TypeScript team is already working on TypeScript 5.3, and the recently posted TypeScript 5.3 Iteration Plan gives developers a sneak peek at what features might be included. One of the most interesting features is Import Attributes, a TC39 proposal that allows developers to specify options for imports, such as the type of a JSON import or a dynamic import. This change aims to provide JavaScript with a way to validate imported MIME types for security purposes. Another proposed feature is throw Expressions, which would allow developers to throw errors without using a statement. Although unlikely to be included in TypeScript 5.3, the TypeScript team is actively working on this proposal. Additionally, Isolated Declarations is a new feature that aims to speed up type checking in monorepos with deep package dependencies. It would allow faster tools to generate declaration files based on inference. Overall, TypeScript 5.3 brings exciting new features that developers should keep an eye on.