tc39/proposal-decorators

Towards stage 4

ReinsBrain opened this issue Β· 14 comments

Hi, I noticed the proposal made it to stage 3 a ways back in March 2022 and hoping to know if stage 4 might be imminent or if there are blockers.

pzuraq commented

Hey! So there is some cleanup I need to do with the spec, there are some minor errors and it needs to be rebased. However, those aren't really blockers at the moment which Is why I haven't prioritized them (I've been swamped at my current job). The main thing we need now is 2 independent implementations in actual browsers, the feature needs to be fully implemented before we can move to stage 4.

I believe the browser teams are currently working on implementing decorators, I will see if I can reach out for updates soon.

dminor commented

The Firefox implementation is in progress, see https://bugzilla.mozilla.org/show_bug.cgi?id=1781212.

Is there a second browser working on an implementation?

I see that Deno supports decorators already, since Typescript supports stage three decorators (since TS5.0) and Deno transpiles Typescript. I did find a bug in their implementation though: the decorator transpilation is incorrect when the transpiled class is anonymous.

Note that Deno does not transpile .js files, so their implementation should not be considered complete. Also, Deno does not classify a browser for this purposes (given that is uses V8, it's equivalent to Chrome).

I see that Deno supports decorators already, since Typescript supports stage three decorators (since TS5.0) and Deno transpiles Typescript. I did find a bug in their implementation though: the decorator transpilation is incorrect when the transpiled class is anonymous.

They said that they did not support it with TS 5.0 release.

Take note that ES decorators are not yet supported, but we will be working towards enabling them by default in a future version.

https://deno.com/blog/v1.32

With the start of the new year I decided to check back in and am impressed with progress by @dminor and team at firefox : https://bugzilla.mozilla.org/show_bug.cgi?id=1781212

Looks like they are getting close. @pzuraq - any news about other implementers to track?

I haven’t heard any updates yet, will post here as I do! I’ve been pretty swamped this holiday season, so unfortunately have not had much time to spend on Decorators, but will be getting back to it in the next month or so.

@what1s1ove

They said that they did not support it with TS 5.0 release.

From what I remember it was in TS 5.2 release.

@what1s1ove

They said that they did not support it with TS 5.0 release.

From what I remember it was in TS 5.2 release.

Hey @jcayzac !
The decorators feature was part of TypeScript 5.0 and the decorators metadata feature was a part of TypeScript 5.2.

But this is no longer important, because a few days ago Deno 1.40 was released, where support for the decorators feature appeared.

This is a bit of a duplicate of #476 so I'm going to close it, we can continue to discuss implementation status over there

It feels rather unfortunate that github can't close issues as duplicates, since now you're saying that stage 4 has been completed and I just double checked and it has not been

Ah, sorry about that! Seems like there's a way to do that so I'll keep that in mind in the future.