TypeScript 5.5+: Isolated Declarations and Beyond
Understand isolatedDeclarations and recent performance wins.
TypeScript 5.5 Overview
TypeScript 5.5 (June 2024) introduced inferred type predicates, isolated declarations support, regex syntax checking, and significant editor performance improvements.
// npm install typescript@5.5Inferred Type Predicates
TS 5.5 can now automatically infer is type predicates from function bodies that narrow a parameter, without requiring an explicit annotation.
// Before 5.5: had to annotate manually
function isString(val: unknown): val is string {
return typeof val === "string";
}
// After 5.5: TypeScript infers the predicate automatically
function isString(val: unknown) {
return typeof val === "string";
}
// Inferred: (val: unknown) => val is stringAll lessons in this course
- TypeScript 5.0: Decorators Standard and const Type Params
- TypeScript 5.1-5.2: Improved Inference
- TypeScript 5.3-5.4: New Narrowing and NoInfer
- TypeScript 5.5+: Isolated Declarations and Beyond