jayphelps / core-decorators

Library of stage-0 JavaScript decorators (aka ES2016/ES7 decorators but not accurate) inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more. Popular with React/Angular, but is framework agnostic.
MIT License
4.52k stars 263 forks source link

The decorator proposal is stage-2 #109

Closed slikts closed 7 years ago

slikts commented 7 years ago

Source

jayphelps commented 7 years ago

Indeed, it is at stage-2, however this library only supports stage-0 of the spec. stage-2 version of the spec has some major, breaking changes from stage-0 and AFAIK no compiler currently supports the stage-2 version of the spec, so I have not yet upgraded core-decorators because there would be no way to use or test it.

Right below that paragraph it explains it:

These are stage-0 decorators because while the decorators spec has changed and is now stage-2, no transpiler has yet to implement these changes and until they do, this library won't either.

If you know of a compiler that does, let me know! If it doesn't say, it probably doesn't. babel-plugin-transform-decorators-legacy supports stage-0, TypeScript mentions stage-2 in the docs in passing but actually supports stage-0 of the spec (confusing af)

I appreciate the PR though! 👍