icon
img

The TypeScript train keeps rolling! With the release of TypeScript 5.9, the team has delivered a set of focused but powerful improvements that tackle two key areas: fixing a long-standing JavaScript interoperability pain point and significantly enhancing the developer experience right in your editor.
While not a monolithic update, 5.9 packs a punch with Deferred Module Evaluation and Expandable Inlay Hover Tips. Let's dive in and see what these mean for your daily coding life.

Deferred Module Evaluation: Taming Circular Chaos
If you've ever worked deeply with modules, especially when mixing and matching CommonJS and ESM, you've likely run into a dreaded "circular dependency" issue. It's a classic problem where Module A imports Module B, which in turn imports Module A, creating a loop that can break your code at runtime.
The Old Headache
Previously, TypeScript (and the JavaScript it emulated) evaluated modules in a depth-first order. When a circular dependency occurred, you could end up trying to use a value from a module before it had been initialized. This often resulted in confusing errors or the infamous undefined value.

Old & Problematic Behavior (Circular Imports)

//  Old & Problematic Behavior // moduleA.js
import { b } from './moduleB.js';
export const a = b + 1;

// moduleB.js
import { a } from './moduleA.js';
export const b = a * 2; // 'a' is undefined here at evaluation time!
The 5.9 Solution TypeScript 5.9 changes its emit strategy to use deferred module evaluation. In simple terms, it modifies the generated code so that a module's exports are set up before any of its code is executed. This breaks the cyclic dependency chain and ensures that when another module tries to import a value, the reference at least exists, even if it hasn't been fully initialized yet.
What this means for you:
Fewer Surprises: Code with circular dependencies becomes more predictable and is far less likely to throw mysterious undefined errors at runtime.
Smoher Interop: This is a huge win for compatibility, especially in Node.js projects that use a mix of require and import statements. It aligns TypeScript's output more closely with how native ECMAScript modules behave in runtimes like Node.js and browsers.
It's a Fix, Not a Feature: Remember, this is primarily a behind-the-scenes change to prevent crashes. It doesn't make circular dependencies a good practice—they can still make your code hard to reason about! But it does make them much less likely to cause a runtime failure, which is a major stability improvement.
Expandable Inlay Hover Tips: No More "Hover-Jacking"
If you're a Visual Studio Code user (and let's be honest, most TypeScript devs are), you've fallen in love with inlay hints. Those helpful little labels that show parameter names and variable types right inline have become indispensable.

However, they had one major annoyance: hover-jacking. You'd try to hover over a variable to see its full type, but your cursor would inevitably pass over an inlay hint, causing the tiny hint tooltip to pop up and block the much more detailed hover information from the main language server.

TypeScript 5.9 and VS Code (via the latest SDK) have finally solved this!
What's new:
Inlay hints in your editor are now expandable. When you hover over one, you'll see a faint chevron (›). Clicking on it or hovering for a moment will expand the hint into a full, rich hover card.
What this means for you:
A frictionless workflow: The flow of "see hint -> want more info -> get more info" is now seamless. No more frantic cursor jiggling to avoid the wrong tooltip.
Best of both worlds: You keep the cleanliness of minimal inlay hints and get instant access to comprehensive documentation, type definitions, and JSDoc comments without any context switching.
A pure UX win: This is one of those quality-of-life improvements that you'll feel every single day. It removes a tiny but frequent dose of friction, making the development experience noticeably smoother. Other Notable Updates As with every release, there are a few smaller improvements:
Performance Optimizations: The team is always grinding away on performance. This release includes optimizations in type creation and checking, which should make everything feel just a bit snappier.
Improvements: The directive now better supports suppressing errors related to module resolution, like Cannot find module '...' or its corresponding type declarations.
How to Get It:
You can get the latest version through npm: bash npm install -D typescript@latest If you're using Visual Studio Code, you can either wait for the update to roll out to your version or use the VS Code Insiders build to try it with the latest TypeScript support immediately.
Final Thoughts:
TypeScript 5.9 might not have a long list of flashy new syntax features, but its changes are profoundly practical. Deferred module evaluation adds robustness to your application's foundation, preventing nasty runtime errors. Meanwhile, expandable inlay hints remove a daily annoyance and make your editor a more intelligent and helpful partner. It's a release that proves the TypeScript team is just as focused on maturity, stability, and developer happiness as it is on innovation. It's an easy recommend to upgrade.
img
img