Skip to content

Instantly share code, notes, and snippets.

@titerman
Created August 12, 2022 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save titerman/fed2b24f9348ad2d03799ee0c43949f2 to your computer and use it in GitHub Desktop.
Save titerman/fed2b24f9348ad2d03799ee0c43949f2 to your computer and use it in GitHub Desktop.
Breaking Changes List: TypeScript 3.9 -> TypeScript 4.7

The following breaking changes occurred between the release of TypeScript 3.9 and the release of TypeScript 4.7:

TypeScript 4.0

  • Attempts to override a parent class's accessor with a property declaration now yield an error (4.0).
  • If you enable the --strictNullChecks compiler flag, you have to provide optional arguments for delete operators (4.0)

TypeScript 4.1

  • Users cannot mark abstract members as async (4.1).
  • The resolve() function in a Promise must return a value (4.1).
  • When you enable the --strictNullChecks compiler flag, && expressions that contain any or unknown type variables become falsy (4.1).
  • Conditional object spreads create optional properties (4.1).

TypeScript 4.2

  • TypeScript outputs a noImplicitAny error when it encounters a yield expression that isn't contextually typed (4.2).
  • New parsing approach for illegal Type arguments in JavaScript code (4.2).
  • Placing a primitive type on the right side of an in expression yields an error (4.2).

TypeScript 4.3

  • TypeScript does not allow the comparison of union enum objects to Numbers (4.3).

TypeScript 4.4

  • The TypeScript compiler discards the this value of functions on import (4.4).
  • unknown type variables in catch clauses yield errors with the --strict compilation flag (4.4).
  • The detection of missing await calls has been improved (4.4).
  • TypeScript no longer allows you to initialize abstract properties (4.4).

TypeScript 4.5

  • Minor changes to lib.d.ts declarations may affect the compilation process (4.4 and 4.5).
  • The introduction of the Awaited type changed the handling of explicit type arguments for asynchronous functions (4.5).
  • TypeScript concatenates Template Strings regardless of the build target (4.5).
  • The compiler yields an error when it discovers a valid compiler option at the root of tsconfig.json (4.5).
  • New assignability restrictions for conditional types (4.5).

TypeScript 4.6

  • TypeScript omits unspreadable properties from generic rest types (4.6).
  • The TypeScript compiler now yields syntax and binding errors for JavaScript code (4.6).

TypeScript 4.7

  • JSX files are subject to stricter ...spread checks (4.7).
  • Strings in template expressions are subject to stricter checks (4.7).
  • The readFile method is now mandatory for LanguageServiceHost instances (4.7).
  • The length property of readonly tuples is now also readonly (4.7).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment