With 5.0, Microsoft is working to make the language smaller, easier, and quicker. For instance, the 5.0 beta takes 81% of the time to construct VS Code that might take TypeScript 4.9 to take action.
These efficiency enhancements had been doable as a result of TypeScript was lately migrated to modules from namespaces. This enables it to leverage extra fashionable construct tooling.
In keeping with Microsoft, there was assist for “experimental” decorators for years, and whereas these have been helpful to builders, they had been modeled after an outdated model of the decorators proposal and required an opt-in compiler flag: – -experimentalDecorators. This flag will nonetheless be supported for now, however the change is that decorators will now work even with out that flag.
The corporate additionally famous that the brand new Decorators characteristic gained’t be appropriate with — emitDecoratorMetadata, however there could also be future ECMAScript proposals that bridge the hole in code that makes use of this.
Different updates on this launch embrace:
- The “extends” subject has been up to date to allow configuration from a number of config recordsdata.
- A “const” modifier may be added to kind parameter declarations.
- All enums will now be thought of union enums. That is achieved by creating a novel kind for every laptop member. The results of that is that each one enums
- New choices for enabling or disabling options based mostly on configuration
- Help for “export kind *”
A full record of updates may be discovered right here.