Users of TypeScript 5.0, which is currently in a release candidate stage, will need to be running Node.js 12 at a minimum. Instead,
npm installs promises to run a little faster and take up less space, with the
typescript the package size was reduced by about 46%, Microsoft said in a March 9 bulletin. TypeScript will also be faster, with compile times reduced by 10-25%. TypeScript API consumers will probably not be affected.
TypeScript won’t ship its API as ES modules yet. An API created by CommonJS will continue to be provided, and existing build scripts will continue to work.
Providing background on the transition, Microsoft said that the current TypeScript codebase predates ECMAScript modules, which were standardized in 2015. Not knowing how compatible ES modules would be with other module systems like CommonJS, and not seeing a great benefit for building modules in time, TypeScript instead used
namespacesformerly called internal modules.
Moving to modules allows TypeScript developers to close the experience gap with their users, speed up TypeScript development and make TypeScript faster, Microsoft said. However, although TypeScript is now written with modules, the actual JS files have not changed their format. Libraries still act like CommonJS when running in a CommonJS environment.
Copyright © 2023 IDG Communications, Inc.
Be First to Comment