News

TypeScript 5.8 Beta Speeds Program Loads, Updates

One feature Microsoft's new TypeScript 5.8 beta release is optimized program loads and updates.

"TypeScript 5.8 introduces a number of optimizations that can both improve the time to build up a program, and also to update a program based on a file change in either --watch mode or editor scenarios," said Daniel Rosenwasser, principal program manager, in a Jan. 29 blog post.

Two key optimizations there include:

  • Efficient Path Normalization: Instead of creating arrays to store path segments while normalizing file paths, TypeScript now works more directly with string indexes of the original path. This reduces memory allocations and speeds up processing, which is especially helpful for large projects with many files.
  • Reduced Configuration Revalidation: When making edits that don't alter the project's structure, TypeScript avoids re-checking configuration settings like tsconfig.json options. Instead, it reuses previous validation results, improving responsiveness in large projects.

A few other highlights of the v5.8 preview include:

  • Checked Returns for Conditional and Indexed Access Types: TypeScript 5.8 enhances type inference by allowing functions to have return types that depend on their parameters. This means that the return type can be more precisely determined based on the input, reducing type errors and improving code clarity.
  • Support for require() of ECMAScript Modules in --module nodenext: In the --module nodenext mode, TypeScript 5.8 introduces support for using the require() function to import ECMAScript modules. This enhancement improves compatibility with existing Node.js codebases that utilize require() for module loading.
  • Preserved Computed Property Names in Declaration Files: TypeScript 5.8 now preserves computed property names in generated declaration files. This means that when using computed properties in your code, the generated .d.ts files will accurately reflect these properties, ensuring better type safety and consistency across your project.

Others include constructs including:

  • The --module node18 flag
  • The --erasableSyntaxOnly option
  • The --libReplacement Flag

These updates aim to enhance TypeScript's type safety, module compatibility, and declaration file accuracy, providing developers with a more robust and efficient toolset, the announcement indicated.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • New 'Visual Studio Hub' 1-Stop-Shop for GitHub Copilot Resources, More

    Unsurprisingly, GitHub Copilot resources are front-and-center in Microsoft's new Visual Studio Hub, a one-stop-shop for all things concerning your favorite IDE.

  • 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.

Subscribe on YouTube