loganfsmyth / babel-plugin-transform-decorators-legacy

A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5
MIT License
817 stars 57 forks source link

What can be done to make decorators real in and move from stage-1 to stage-4? #71

Closed jason-henriksen closed 6 years ago

jason-henriksen commented 6 years ago

I don't even know who to ask the question of. But not having decorators in the javascript language seems really absurd to me coming form C# & Java. Especially since we have something that works.

Do you know who I can talk to and volunteer to move this part of the spec along?
Is it just politics or is there something holding this back?

I've googled around but everything says "It's not ready" vs "Here's how you can help".

Thanks!

loganfsmyth commented 6 years ago

I've googled around but everything says "It's not ready" vs "Here's how you can help".

Fair. If you're coming from outside the community it may not be easy to initially grasp how it's all done.

But not having decorators in the javascript language seems really absurd to me coming form C# & Java.

It's certainly valid to feel they are a useful pattern, but the language has survived this long without them, so it's clearly not a massive rush. Bringing patterns from other languages really can be a great strength, but doing so without extreme care is something that would worry me far more than adopting things too slowly.

Especially since we have something that works.

The implementation in this repo is wildly different from the current proposed specification, so it probably depends on your definition of "works".

Do you know who I can talk to and volunteer to move this part of the spec along?

The specification is managed by TC39, the standards committee. Proposals are moved forward by members of the committee presenting them and gathering feedback. https://github.com/tc39/proposals tracks the current status of the proposals, with decorators being tracked in https://github.com/tc39/proposal-decorators I'm not sure there's much for an external volunteer to accomplish unfortunately.

Is it just politics or is there something holding this back?

As far as I'm aware it's mostly that it's a complex feature, and the committee members working on the proposal are mostly focusing their time on other proposals that will have a greater impact on the community.

jason-henriksen commented 6 years ago

Thank you tremendously for that thoughtful and well written comment!

I respectfully disagree about the level of impact. To me, annotations are one of the very best ways that other languages reduce redundant boilerplate. MobX with decorators is a dream to use. Without decorators, it's still very powerful but much less easy to read and work with. I personally think that is true in many areas of javascript that could benefit from decorators.

I will follow the links you suggest and shake trees there looking for ways that I can contribute to making this happen. Thank you again for taking the time to write back in such excellent detail!

jason-henriksen commented 6 years ago

Ug. So I've realized why all the mobx components are able to compile without concern about decorators. It looks like they've all moved to typescript where decorator support is still main line.

I don't particularly want to add typescript to my dependencies list, but if babel doesn't easily support decorators and typescript does... I guess I'm moving over to typescript.

I still really appreciate this comment. I'll look around to see if there's anything I can do to help but this is a deciding feature for me personally.

loganfsmyth commented 6 years ago

if babel doesn't easily support decorators and typescript does

Typescript's support is basically the same as what is implemented in this repository, so it shouldn't really be a blocker. Using this plugin with Babel should continue to work fine. We don't plan on breaking this plugin at the moment, it's just that it isn't a standard part of the language yet. At some point once it is, Typescript will have to transition to that too, but it probably has the stabilize a bit first.