News

What's New in TypeScript 5.5, Now Generally Available

Microsoft shipped the latest iteration of its type-infused superset of JavaScript, TypeScript 5.5, introducing inferred type predicates, control flow narrowing, JSDoc @import and other enhancements.

"Although JavaScript is used to create cross-platform apps, it wasn't conceived for large apps involving thousands, or even millions, of lines of code," Microsoft explains. "JavaScript lacks some of the features of more mature languages that power today's sophisticated applications. Integrated development editors (IDEs) can find it challenging to manage JavaScript and maintain these large code bases.

"TypeScript addresses the limitations of JavaScript, doing so without compromising the key value proposition of JavaScript: the ability to run your code anywhere and on every platform, browser, or host."

Early this year, the firm RedMonk placed TypeScript at No. 6 (in a tie with CSS) in its language rankings.

TypeScript Tied for 6th
[Click on image for larger view.] TypeScript Tied for 6th (source: RedMonk).

Here's a summary of new features in v5.5, as described in a June 20 announcement.

  • Inferred Type Predicates: Automatically infers type predicates for functions that return boolean values, allowing TypeScript to better understand and narrow types based on the function's return type.
  • Control Flow Narrowing for Indexed Accesses: Enhances type narrowing for constant indexed property accesses, improving type checking precision and reducing potential errors.
  • JSDoc @import Tag: Introduces a new JSDoc tag to simplify importing types in JavaScript projects, making it easier to integrate TypeScript's type checking capabilities.
  • Regular Expression Syntax Checking: Adds syntax validation for regular expressions, ensuring they are correctly formed and reducing runtime errors.
  • New ECMAScript Set Methods: Supports new ECMAScript methods such as union, intersection, and difference for Set objects, aligning with the latest ECMAScript standards and enhancing functionality.
  • Isolated Declarations: Introduces the --isolatedDeclarations option, allowing developers to generate declaration files without requiring a full type check, speeding up the build process.
  • The ${configDir} Template Variable for Configuration Files: Adds a template variable for specifying paths in configuration files, providing more flexibility in project setups.
  • Consulting package.json Dependencies for Declaration File Generation: Uses dependencies listed in package.json to assist in generating declaration files, ensuring accurate type definitions.
  • Editor and Watch-Mode Reliability Improvements: Enhances reliability and performance in editor integrations and watch mode, providing a smoother development experience.
  • Performance and Size Optimizations: Includes various optimizations to improve compiler performance and reduce the size of generated output, making builds faster and more efficient.
  • Easier API Consumption from ECMAScript Modules: Simplifies the process of consuming APIs from ECMAScript modules, improving interoperability and developer experience.
  • The transpileDeclaration API: Introduces a new API for transforming TypeScript declarations, offering more control and customization for advanced use cases.

The next version, TypeScript 5.6, is expected to ship in early September, with iteration plans listed on the GitHub-hosted issue tracker.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

  • Copilot Agentic AI Dev Environment Opens Up to All

    Microsoft removed waitlist restrictions for some of its most advanced GenAI tech, Copilot Workspace, recently made available as a technical preview.

Subscribe on YouTube