News

New TypeScript 4.2 Tweaks Include Project Explainer

Microsoft shipped TypeScript 4.2 -- the regular quarterly update to the open source programming language that improves JavaScript with static typing -- with a host of tweaks including a way to explain why files are included in a project.

In announcing the new version this week, program manager Daniel Rosenwasser highlighted 10 top new items of interest, including a new --explainFiles flag that does exactly what its name suggests.

The new flag stems from an August 2020 pull request (#40011) titled "Keep track of why files are in the program."

That resulted in the new tsc --explainFiles flag that trips the compiler into generating verbose ouput explaining why a file is in a program. That verbose output can in turn be injected into a text file, for example, or a utility program or a code editor like Visual Studio Code for easy viewing.

"A surprisingly common scenario for TypeScript users is to ask 'why is TypeScript including this file?' " Rosenwasser explained. "Inferring the files of your program turns out to be a complicated process, and so there are lots of reasons why a specific combination of lib.d.ts got used, why certain files in node_modules are getting included, and why certain files are being included even though we thought specifying exclude would keep them out."

He explained how the typical output looks as it details the reasoning behind the inclusion of those lib.d.ts files, then the the local files and then the node_modules files, though the format of the output may change in the future, something the team would like to hear feedback on.

Other tweaks highlighted by Rosenwasser -- with links for more information -- include:

Also, several breaking changes are in this release.

Going forward, the TypeScript 4.3 Iteration Plan provides a peek into what's in store with the next quarterly version, scheduled for May 25.

That plan lists upcoming language features, editor productivity improvements, better performance and enhancements to infrastructure and more.

The New TypeScript Web Site
[Click on image for larger view.] The New TypeScript Web Site (source: Microsoft).

It also calls for improvements to the new TypeScript web site that was unveiled in the August 2020 v4.0 milestone release.

Planned improvements to the web site include:

  • Continue smoothing out first user experience
  • Create project setup documentation
  • Fix display issues on sample error spans
  • Switch to new handbook

Other things planned for v4.3 are listed in the TypeScript Roadmap:

Going even further out, the dev team says "Future" plans include a number of significant initiatives, including a proposed item dating back to 2014, "Investigate nominal typing support" as explained in a GitHub issue titled "Support some non-structural (nominal) type matching."

It proposes to "support non-structural typing (e.g. new user-defined base-types, or some form of basic nominal typing). This allows programmer to have more refined types supporting frequently used idioms [such as indexes that come from different tables]."

That issue has garnered a lot of discussion and activity, being marked by a whopping 508 "thumbs-up" đź‘Ťsymbols and 401 comments.

Other issues tasked for "Future" consideration include:

Microsoft is soliciting feature requests, bug reports and library improvements on GitHub here, where there are also links to the language's FAQ, Stack Overflow Q&A, Discord chat and more.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

  • Steve Sanderson Previews AI App Dev: Small Models, Agents and a Blazor Voice Assistant

    Blazor creator Steve Sanderson presented a keynote at the recent NDC London 2025 conference where he previewed the future of .NET application development with smaller AI models and autonomous agents, along with showcasing a new Blazor voice assistant project demonstrating cutting-edge functionality.

Subscribe on YouTube