Navigation
Search
|
TypeScript 5.6 enters release candidate stage
Friday July 26, 2024. 11:18 PM , from InfoWorld
TypeScript 5.6, an update to Microsoft’s strongly typed JavaScript variant, has moved to the release candidate (RC) stage. With the RC, Microsoft has renamed a number of new types and reverted a change to how the TypeScript language service searched for tsconfig.json files. These features join previous beta capabilities that include disallowing nullish and truthy checks on syntax that never varies on nullishness or truthiness.
The TypeScript 5.6 RC, which follows a July 26 beta release, was announced August 23. The RC can be accessed through NPM by running npm install -D typescript@rc. In reverting the change in how the language service searches for tsconfig.json files, the RC addresses a situation in which the language service would keep looking for every possible project file named tsconfig.json that might contain a file. Because this could lead to opening many referenced projects, the behavior has been reverted, while Microsoft investigates ways to bring back the behavior in TypeScript 5.7. Microsoft said several new types have been renamed since the beta. Previously, TypeScript provided a single type called BuiltinInterator to describe every value backed by Iterator.prototype. This type has been renamed IteratorObject in the RC, and has been given a different set of type parameters. It also adds several subtypes such as ArrayIterator and MapIterator. Also in the RC, a new flag called --stopOnBuildErrors has been added for --build mode that stops builds if a project builds with any errors. New editor functionality also has been added including direct support for commit characters and exclude patterns for auto-imports. Prior to the RC, the TypeScript 5.6 beta introduced a variety of changes. For disallowed nullish and truthy checks, the compiler now errors when it can syntactically determine that a truthy or nullish check will always evaluate in a specific way. Microsoft said “many, many bugs” could be caught this way. Some expressions still are allowed even if truthy or nullish. Specifically, true, false, 0, and 1 are all still allowed despite always being truthy or falsy. TypeScript 5.6 also introduces a native or built-in iterable type called BuiltinIterator. It is defined as follows: interface BuiltinIterator { { // … } The first stable release of TypeScript 5.6 is due in a few weeks. TypeScript 5.6 follows TypeScript 5.5, which was released June 20. Other new features and improvements in TypeScript 5.6: A new compiler option is introduced, --noCheck, which allows developers to skip type checking for all input files. This avoids unnecessary type checking when performing semantic analysis necessary for emitting output files. TypeScript 5.6 introduces a new feature called region-prioritized diagnostics or region-prioritized checking. Instead of just requesting diagnostics for a set of files, editors now can provide a relevant region of a given file. The idea is that this will typically be the region of the file that is currently visible to a user. Previously, computed properties marked with override did not correctly check for the existence of a base class member. Similarly, if developers used noImplicitOverride, they would not get an error if they forgot to add an override modifier to a computed property. TypeScript 5.6 now correctly checks computed properties in both cases.
https://www.infoworld.com/article/3478113/typescript-5-6-takes-aim-at-truthy-and-nullish-bugs.html
Related News |
25 sources
Current Date
Dec, Sun 22 - 06:55 CET
|