Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test static decorator proposal #296

Closed
dongryphon opened this issue Aug 17, 2019 · 8 comments
Closed

How to test static decorator proposal #296

dongryphon opened this issue Aug 17, 2019 · 8 comments

Comments

@dongryphon
Copy link

I worked extensively with the previous, dynamic Stage 2 proposal using Babel. It does not appear to support the new static proposal, so is there any way to experiment with this and provide feedback?

@ljharb
Copy link
Member

ljharb commented Aug 17, 2019

See #294, #265, and a number of others; there's a lot of unanswered questions, including how and if it will be possible to use the new form with babel.

@dongryphon
Copy link
Author

Thanks for the references. I was seeing folks talk about using this proposal so I assumed there was some way to do so. I'm not wedded to Babel as the only way... any way would be welcome at this point.

@ljharb
Copy link
Member

ljharb commented Aug 18, 2019

Substitute babel with any transpiler - it’s not yet clear how it will be possible to use the new proposal prior to a native implementation.

@justinfagnani
Copy link

It will definitely be possible. That a transpiler might have to load more than one file doesn't make it impossible. This would be true of any macro-like system where you want to do expansion at build time - the compiler needs the macro definitions.

@nicolo-ribaudo
Copy link
Member

I will open a PR to the Babel repo in less than a month, with support for decorators defined in the same file. It's not full support for what this proposal specifies yet, but it will allow you to experiment with it.

@ljharb
Copy link
Member

ljharb commented Aug 18, 2019

@justinfagnani there also has to be a way to support both native and nonnative decorators in the dep graph at the same time, or else ecosystem usage will be forked between native and transpiled. It’d be better for babel not to add any support, than for that to happen.

@littledan
Copy link
Member

@ljharb You've raised these issues in several threads before; it's a bit off-topic to repeat yourself here. I think these questions all have good answers, some of which will be provided constructively by an implementation, and others of which will have documentation improvements.

If you want to test out static decorators, you can help move that along by reviewing @nicolo-ribaudo 's in-progress implementation at babel/babel#10388

@nicolo-ribaudo
Copy link
Member

This can probably be closed now that the proposal has been rewritten?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants