3 ms·
> typescript's decorators Typescript has decorators?!! Damn, i wish I'd know about this 3 months ago.
by biorach 4y ago
> typescript's decorators
Typescript has decorators?!!
Damn, i wish I'd know about this 3 months ago.
- WorldMaker 4y ago~3 months ago the TC-39 (ES/JS language steering committee) hadn't moved their decorators proposal to Stage 3 and Typescript hadn't implemented it yet. Typescript supported a much older (and different) decorators proposal under an experimental compiler flag, but my momma always taught me never to use flags marked "experimental" in Production.
- lioeters 4y agoDecorators in TypeScript is still an experimental feature which may change depending on if/how it's implemented in JavaScript. > To enable experimental support for decorators, you must enable the experimentalDecorators compiler option either on the command line or in your tsconfig.json https://www.typescriptlang.org/docs/handbook/decorators.html https://www.typescriptlang.org/docs/handbook/decorators.html > ..the current decorators proposal, which is a work in progress https://github.com/tc39/proposal-decorators https://github.com/tc39/proposal-decorators Oh, but I see that the proposal is now at Stage 3, which means the specs and syntax are stable ("completely described") and ready for browsers to implement. On further digging, it seems decorators will be a standard feature included in TypeScript 5.0 planned for release on March 14th. TypeScript 5.0 Iteration Plan - https://github.com/microsoft/TypeScript/issues/51362 https://github.com/microsoft/TypeScript/issues/51362