Internet & Software Tips

TypeScript 6.0 beta forms the basis for switching the codebase from JavaScript to Go

Microsoft has announced the beta of TypeScript 6.0, which will be the final release of the language using the JavaScript codebase.

The company announced last year that it was working on a native implementation of TypeScript written in Go, in an effort to improve the programmer’s startup time, reduce build time, and reduce memory usage.

“Since the introduction of TypeScript more than a decade ago, TypeScript has written itself,” said Anders Hejlsberg, TypeScript’s lead architect, back when the program was first announced. “That brought a lot of benefits, but also invariably brought challenges, especially in terms of performance and scalability. The JavaScript runtime platform is really optimized for UI and browser usage, and not so much for computationally intensive tasks like compilers and system-level tools.”

Writing TypeScript in Go will allow it to increase the speed of native code and multi-processing in shared memory, Daniel Rosenwasser, principal product manager at Microsoft, explained in a new blog post.

According to him, TypeScript 6.0 will lay the foundation for TypeScript 7.0 and beyond, and act as a bridge from TypeScript 5.9 and 7.0.

Many of the features available in this beta are designed to support this change. For example, for a producer, strict now true by mistake, module default to esnext, target default in the current version of ES, noUncheckedSideEffectImports now true automatically, too libReplacement now false by mistake.

In addition, rootDir now automatically changes to the directory containing the tsconfig.json file, rather than having its location dictated based on the common directory of all trivial input files.

I types field of compilerOptions and now it happens in an empty array, []. “This change prevents projects from unintentionally pulling in hundreds or thousands of unnecessary declaration files during a build. Many projects we’ve looked at have improved their build time anywhere from 20-50% by setting types correctly,” explained Rosenwasser.

TypeScript 6.0 also introduces several deprecations, including i target: es5 option; –downlevelIteration; --moduleResolution node; amd, umdagain systemjs values ​​of module; --baseUrl; --moduleResolution classic; --esModuleInterop false again --allowSyntheticDefaultImports false; --alwaysStrict false; --outFile; inheritance module the syntax of namespaces; asserts keyword in the input; again no-default-lib Instructions.

Developers can override this deprecation in TypeScript 6.0 by setting “ignoreDeprecations”: “6.0”but 7.0 will not support any deprecated options.

According to Microsoft, these changes were designed in line with several shifts in how developers write and deploy JavaScript since the release of TypeScript 5.0.

While most of the work in this release is on fixing things for TypeScript 7.0, the team is also introducing new features, which are described in detail in the company’s blog post.

Microsoft says that TypeScript 6.0 is now considered a “stable feature” and no more new features or breaking changes will be added. The TypeScript team will spend the next few weeks addressing issues reported in the codebase while continuing to work on TypeScript 7.0.

“As for the schedule between TypeScript 6.0 and 7.0, we plan to have 7.0 released immediately after 6.0. This should help us maintain some continuity in our development and the opportunity to address issues immediately after the release of 7.0,” said Rosenwasser.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button