News

What's New in TypeScript 5.2

Microsoft shipped TypeScript 5.2, the latest edition of the popular programming language that adds the optional ability to use type systems when working with JavaScript.

Its host of new features range from better resource management to copying array methods to inline variable refactoring and more.

Microsoft shipped the new version last week after a string of previews, with Daniel Rosenwasser, senior program manager for TypeScript, summarizing the work so far since TypeScript v5.1 shipped in June.

"Since the Beta, we've added a type-checking optimization and made it possible to reference the paths of TypeScript implementation files in type-only imports," he said.

"Since the RC, we've also documented the addition of Copying Array Methods, symbols as WeakMap and WeakSet Keys and Clickable Inlay Parameter Hints. This release also documents a small breaking change around always emitting the namespace keyword in declaration files."

[Click on image for larger view.] Clickable Inlay Parameter Hints (source: Microsoft).

Several of the new features implement functionality introduced in ECMAScript, the standard for JavaScript. One of those is the upcoming Explicit Resource Management feature, described in a GitHub proposal as "a common pattern in software development regarding the lifetime and management of various resources (memory, I/O, etc.). This pattern generally includes the allocation of a resource and the ability to explicitly release critical resources."

Rosenwasser noted that current implementations of the functionality add "noise" to code and could cause other problems. After an exhaustive explanation of the feature, he summarized it this way: "The key idea of the proposal is to support resource disposal -- this clean-up work we're trying to deal with -- as a first class idea in JavaScript."

With the new support enacted by a new built-in symbol called Symbol.dispose, TypeScript will automatically call that disposal method on those resources -- or objects -- when they go out of scope, via using declarations.

Another upcoming ECMAScript feature concerns decorator metadata, which seeks to extend the Decorators proposal (used to extend JavaScript classes) with the added ability for decorators to associate metadata with the value being decorated. "The key idea of this feature is to make it easy for decorators to create and consume metadata on any class they're used on or within," Rosenwasser said.

And yet another ECMAScript feature addressed in TypeScript 5.2 concerns copying array methods, with Rosenwasser explaining that the new version includes definitions for the methods added to ECMAScript in the "Change Array by Copy" proposal. Typically copying arrays requires jumping through some hoops if you want to do so without affecting the original array. That issue is addressed via JavaScript's four new methods to perform various array copying operations without affecting the original data: toSorted, toSpliced, toReversed and with.

Other highlights of the release include:

  • Support for named and anonymous tuple elements
  • Easier method usage for unions of arrays
  • Symbols as WeakMap and WeakSet keys
  • Type-only import paths with TypeScript implementation file extensions
  • Comma completions for object members
  • Inline variable refactoring
  • Optimized checks for ongoing type compatibility
  • Breaking changes and correctness fixes

Going forward, developers can see what's on tap in the TypeScript 5.3 Iteration Plan for the next release, coming Nov 14.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Using Local AI to Cut Copilot Usage-Based Billing Shock

    After being gobsmacked by the new billing plan using almost all my monthly credits in one or two days, I tried pushing some Copilot-style coding work onto local models in VS Code. What I found was less "free AI" and more "pick your pain": cloud charges on one side, heavy local resource use and long waits on the other.

  • .NET 11 Preview 5 Focuses on Performance, Productivity and Safer Code

    .NET 11 Preview 5 focuses on under-the-hood runtime performance gains, streamlined APIs and language features that reduce boilerplate, plus built‑in security checks and incremental ASP.NET Core and EF Core improvements aimed at everyday developer productivity.

  • VS Code 1.124 Focuses on Agent Autonomy and Parallel Sessions

    Microsoft's June 2026 VS Code update turns on Autopilot by default and adds background sending for agent sessions.

  • Developing Agentic Systems in .NET: From Concept to Code

    ZioNet founder Alon Fliess previews his Visual Studio Live! San Diego session on building true agentic systems in .NET -- covering the cognitive loop, MCP tool integration, multi-agent orchestration and enterprise hosting and governance with the Microsoft Agent Framework.

Subscribe on YouTube