proposal-decorators
proposal-decorators copied to clipboard
Implementation Status
I checked some of the engine/tool issue trackers and couldn't find any clear signal on what the status of the proposal is when it comes to stage 3 implementations. What I found so far:
- [x] Babel: v7.19.0 (blog post). ~Babel is actively working on aligning with the latest revision, see https://github.com/babel/babel/pull/14836.~
- [x] TypeScript: v5.0.0 (blog); metadata in v5.2.0 (blog).
- [x] esbuild: v0.21.0; metadata in v0.21.3
- [ ] V8 has started work on accessors and decorators.
- [ ] Spidermonkey is (somwhat?) actively working on it.
- [ ] I couldn't find a signal from WebKit/JSC though I might have looked in the wrong place(s). @trusktr created https://bugs.webkit.org/show_bug.cgi?id=277593 which may be the most canonical bug.
Does that reflect the current status?
I couldn't find a signal from Babel.
https://babeljs.io/blog/2022/02/02/7.17.0
@nicolo-ribaudo Sorry, should've been more clear. I was thinking specifically about the proposal as it's now in stage 3. E.g. isPrivate
is now private
in the descriptor but (afaict) babel doesn't support this revision yet and I couldn't find an issue to implement it (see current test that still uses isPrivate
).
Have the isPrivate
->private
and isStatic
->static
changes already been presented to the committee for consensus?
Ok, yes: https://github.com/babel/proposals/issues/81#issuecomment-1083336037
Have the isPrivate->private and isStatic->static changes already been presented to the committee for consensus?
@nicolo-ribaudo tc39/proposal-decorators#467 was merged, resolving.
For the stumblers, stage 3 decorators landed in Babel on Sep 5th: https://babeljs.io/blog/2022/09/05/7.19.0 🎉 Here's a small guide on how to use them in TypeScript: https://github.com/microsoft/TypeScript/issues/48885#issuecomment-1247431866
It appears the new decorators won't land on TS before 5.0
Thanks, updated the overview item to "after 4.9".
https://bugzilla.mozilla.org/show_bug.cgi?id=1435869
Anyone know if Chrome or Safari have started implementation?
Chrome seems to be making progress on auto accessors: https://issues.chromium.org/issues/42202709
Updated the description with updated status for TypeScript and V8/Chrome. Also made it easier to skim for shipping versions and turned it into a checklist.
esbuild also includes support for decorators: https://github.com/evanw/esbuild/releases/tag/v0.21.0 and decorator metadata: https://github.com/evanw/esbuild/releases/tag/v0.21.3