Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Microsoft TypeScript 3.0 officially released without disruptive changes

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Computer Software News >

Share

Shulou(Shulou.com)05/31 Report--

On July 31st, Beijing time, Microsoft announced the launch of the official version of TypeScript 3.0. TypeScript 3.0 is a new milestone. Officials say that although the version number is a big change, there are few disruptive changes in version 3.0 (which means we can easily upgrade to it), 3.0 introduces a new flexible and extensible way to build projects, provides new and powerful support for manipulating parameter lists, new types that force explicit checking, better JSX support, better error handling as a whole, and so on.

­the following is a brief description of the updates worth paying attention to. For more detailed update instructions, please move to the release notes.

­Project reference (Project references)

­this is a new concept introduced in version 3.0. Consider a scenario where it is quite common for developers to provide several different build steps for a library or application. Maybe your code base has a src and a test directory. Maybe you put the front-end code in a folder called client and the Node.js back-end code in a folder called server, and each folder imports code from a shared folder. Maybe you use the so-called "monorepo" and there are many projects that depend on each other in complex ways.

­officials say that in response to the above scenario, they have developed one of the most important features for TypeScript 3.0-"Project reference (project references)".

­Project references allow TypeScript projects to rely on other TypeScript projects-- in particular, allow tsconfig.json files to reference other tsconfig.json files. Specifying these dependencies makes it easier to split the code into smaller projects because it provides a way for TypeScript (and the tools around it) to understand the build order and output structure. This means that faster builds can work step by step and support navigation, editing, and refactoring across projects. Because 3. 0 lays the groundwork and exposes API, any build tool can provide this functionality.

­support for defaultProps in JSX

­this feature makes it easier for callers to use functions without requiring certain parameters.

­destructive changes to API destructive changes

­The deprecated internal method LanguageService#getSourceFile has been removed, as it has been deprecated for two years. See # 24540.

­The deprecated function TypeChecker#getSymbolDisplayBuilder and associated interfaces have been removed. See # 25331. The emitter and node builder should be used instead.

­The deprecated functions escapeIdentifier and unescapeIdentifier have been removed. Due to changing how the identifier name API worked in general, they have been identity functions for a few releases, so if you need your code to behave the same way, simply removing the calls should be sufficient. Alternatively, the typesafe escapeLeadingUnderscores and unescapeLeadingUnderscores should be used if the types indicate they are required (as they are used to convert to or from branded _ String and string types).

­The TypeChecker#getSuggestionForNonexistentProperty, TypeChecker#getSuggestionForNonexistentSymbol, and TypeChecker#getSuggestionForNonexistentModule methods have been made internal, and are no longer part of our public API. See # 25520.

­related links:

­release notes https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/

­what's new in TypeScript 3.0: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript

­destructive change https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Computer Software News

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report