News for hackers. Stuff that matters.
Re:<3 Deno by biorach on Monday February 13, 2023 @04:11AM (#34771547)
> typescript's decorators

Typescript has decorators?!!

Damn, i wish I'd know about this 3 months ago.

Re:<3 Deno by WorldMaker on Monday February 13, 2023 @03:04PM (#34779522)
~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.

Re:<3 Deno by lioeters on Monday February 13, 2023 @06:52PM (#34782784)
Decorators 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

> ..the current decorators proposal, which is a work in progress

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