CTO News Hubb
Advertisement
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact
No Result
View All Result
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact
No Result
View All Result
CTO News Hubb
No Result
View All Result
Home IT

TypeScript 5.0 retools decorators | InfoWorld

January 27, 2023
in IT


Microsoft published a beta release of TypeScript 5.0, the company’s strongly typed JavaScript variant, on January 26. The new release aims to modernize decorators for class customization.

Decorators, an upcoming ECMAScript feature, allow for customizing classes and their members in a reusable way, Microsoft noted in a blog post announcing the release. Decorators can be used on methods, properties, getters, setters, and auto-accessors. Classes can be decorated for subclassing and registration. While TypeScript previously supported experimental decorators, these were modeled on a much older version of the decorators proposal.

Also in TypeScript 5.0, developers now can add a const modifier to a type parameter declaration to cause const-like inferences to be the default. The update also now allows the extends field to take multiple entries, and it makes all enums union enums by creating a unique type for each computed member. This means all enums can be narrowed and have their members referenced as types.

TypeScript 5.0 features changes across code structure, data structures, and algorithmic extensions, intended to speed up the entire experience of using JavaScript, even installation. Overall, TypeScript 5.0 is intended to make the language smaller, faster, and simpler. A release candidate is expected February 28, followed by general availability of a production release on March 14.

The TypeScript 5.0 beta can be accessed through NuGet or by running the following command:

npm install typescript@beta

Also in TypeScript 5.0:

  • Better support is offered for ESM (ECMAScript Module) projects in Node and bundlers.
  • A –-verbatimModuleSyntax capability simplifies imports and exports, keeping imports or exports without a type modifier while dropping anything using the type modifier.
  • A new JSDoc tag, @satisfies, catches type mismatches while preserving the original type of an expression, enabling developers to use values more precisely in code. Many developers use TypeScript to type-check JavaScript code using JSDoc annotations. Also, JSDoc now can declare overloads with a new @overload tag.
  • Correctness changes and deprecations are offered for less-used flags.
  • TypeScript now targets ECMAScript 2018. For Node users, this means a minimum version requirement of at least Node.js 10.

The TypeScript 5.0 beta follows the November release of TypeScript 4.9, which featured a satisfies operator to catch errors. TypeScript turned 10 years old in October 2022.

Copyright © 2023 IDG Communications, Inc.



Source link

Previous Post

Will Your Company Be Fined in the New Data Privacy Landscape?

Next Post

Bell Telephone Launched a Mobile Phone During the 1940s: Watch Bell’s Film Showing How It Worked

Next Post

Bell Telephone Launched a Mobile Phone During the 1940s: Watch Bell's Film Showing How It Worked

What about tech leadership makes burnout more likely?

Trending News

Are your hiring practices restricting the attraction of female tech talent?

March 8, 2023

Who Will Blockchain Put out of Business?

December 26, 2022

The Hard Truth About Performance — A Guide for CTOs

December 31, 2022

© 2022 CTO News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy and Terms & Conditions.

Navigate Site

  • Home
  • CTO News
  • IT
  • Technology
  • AI
  • QC
  • Robotics
  • Blockchain
  • Contact

Newsletter Sign Up

No Result
View All Result
  • Home
  • CTO News
  • IT
  • Technology
  • Tech Topics
    • AI
    • QC
    • Robotics
    • Blockchain
  • Contact

© 2021 JNews – Premium WordPress news & magazine theme by Jegtheme.

SUBSCRIBE TO OUR WEEKLY NEWSLETTERS