包阅导读总结
1.
关键词:TypeScript 5.5、Microsoft、Features、Enhancements、Developer Experience
2.
总结:Microsoft 近期发布 TypeScript 5.5,带来众多特性和优化,包括类型推断、表达式验证等改进,注重提升开发者体验和性能,多位分析师给予积极评价,下一个版本 5.6 计划于 9 月初发布。
3.
主要内容:
– TypeScript 5.5 发布
– 提供一系列特性和优化,增强了 JavaScript 超集
– 包括推断类型条件、改进表达式验证等
– 有性能提升和对编辑器可靠性的增强
– 改善开发者体验
– 旨在提供更快的构建过程和更强的工具协助
– 语言的类型增强了代码检查和编辑器工具
– 新特性亮点
– 如推断类型谓词、控制流窄化等
– 正则表达式语法检查等
– 分析师评价
– Holger Mueller 称微软持续投资,TypeScript 实现发明初衷
– Brad Shimmin 认为其在稳定性和规模方面进步,更像 Java 支持企业级部署
– 后续计划
– 包括一些行为变化
– TypeScript 5.6 计划于 9 月初发布
思维导图:
文章地址:https://thenewstack.io/typescript-5-5-faster-smarter-and-more-powerful/
文章来源:thenewstack.io
作者:Darryl K. Taft
发布时间:2024/6/25 13:45
语言:英文
总字数:650字
预计阅读时间:3分钟
评分:85分
标签:JavaScript,软件开发,TypeScript
以下为原文内容
本内容来源于用户推荐转载,旨在分享知识与观点,如有侵权请联系删除 联系邮箱 media@ilingban.com
Microsoft recently released TypeScript 5.5 offering a range of features and optimizations to enhance the company’s JavaScript superset.
This update includes inferred type conditions, improved expression validation and separate declarations, as well as notable performance boosts and enhancements to editor reliability.
Better Developer Experience
The release focuses on improving developers’ experiences. TypeScript 5.5 aims to provide quicker build processes and stronger tooling assistance.
“Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null
and undefined
, and more,” wrote Daniel Rosenwasser, principal product manager for TypeScript at Microsoft, in a blog post. “Types also power TypeScript’s editor tooling like the auto-completion, code navigation, and refactorings that you might see in editors like Visual Studio and VS Code. In fact, if you write JavaScript in either of those editors, that experience is powered by TypeScript!”
Microsoft has made several changes to the language since the beta and release candidate versions of TypeScript 5.5.
For instance, “since the beta, we added support for ECMAScript’s newSetmethods. Additionally, we’ve adjusted the behavior ofTypeScript’s new regular expression checkingto be slightly more lenient, while still erroring on questionable escapes that are only allowed per ECMAScript’s Annex B,” the post said
Microsoft also added and documented moreperformance optimizations: notably, skipped checking in transpileModule
and optimizations in the way TypeScript filters contextual types. These optimizations can lead to faster build and iteration time, the company said.
Summary of Key New Features
Summarized highlights of key new features and improvements in TypeScript 5.5 include:
- Inferred type predicates: Improves type inference in certain scenarios, especially with arrays and filtering.
- Control flow narrowing for constant indexed accesses: Enhances type narrowing for object property accesses.
- The JSDoc
@import
tag: New tag for importing types in JavaScript files without runtime impact. - Regular expression syntax checking: Basic syntax checking for regular expressions to catch common mistakes.
- Support for new ECMAScript
Set
methods: Adds declarations for proposed newSet
methods. - Isolated declarations: New compiler option to help with faster declaration file generation.
- The
${configDir}
template variable: Helps with writing more portable configuration files. - Consulting
package.json
dependencies: Improves declaration file generation by considering package dependencies. - Editor and watch-mode reliability improvements: Various fixes to improve editor experience and watch mode.
- Performance and size optimizations: Multiple improvements to compiler speed and package size.
- Easier API consumption from ECMAScript Modules: Better support for using TypeScript’s API in ESM (ECMAScript Modules) environments.
- The
transpileDeclaration
API: New API for generating declaration files for single files.
Keeps Delivering
Holger Mueller, an analyst at Constellation Research, who harkens back to the initial launch of TypeScript said, “Microsoft keeps investing into TypeScript with the release 5.5. – even if the release of the first .5 release may point to a slowdown. But at its core TypeScript has delivered and keeps delivering what it was invented for: Making JavaScript-based applications scale to enterprise grade and size. The release offers new capabilities across the board, with none sticking out, making it a ‘boring’ but effective release for TypeScript developers.”
The release also includes some behavioral changes, such as disabling features deprecated in TypeScript 5.0. The next version, TypeScript 5.6, is planned for early September.
Meanwhile, Brad Shimmin, an analyst at Omdia, noted, “In short, I’d say that the 5.5 update shows just how far this relatively new language has come in terms of addressing important demands surrounding software stability and scale; it also showcases just how far TypeScript has ventured from its roots in JavaScript. I think it’s fair to say that with new features like syntax checking of regular expressions, which were previously ignored at compile time, TypeScript is starting to look more and more like Java in terms of supporting enterprise-grade deployments.”
YOUTUBE.COM/THENEWSTACK
Tech moves fast, don’t miss an episode. Subscribe to our YouTubechannel to stream all our podcasts, interviews, demos, and more.