With 5.0, Microsoft is working to make the language smaller, less complicated, and quicker. For instance, the 5.0 beta takes 81% of the time to construct VS Code that may take TypeScript 4.9 to take action.
These efficiency enhancements have been doable as a result of TypeScript was lately migrated to modules from namespaces. This enables it to leverage extra trendy construct tooling.
In accordance with Microsoft, there was assist for “experimental” decorators for years, and whereas these have been helpful to builders, they have 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 function received’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 embody:
- The “extends” discipline has been up to date to allow configuration from a number of config information.
- A “const” modifier might be added to kind parameter declarations.
- All enums will now be thought-about 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 primarily based on configuration
- Assist for “export kind *”
A full record of updates might be discovered right here.