-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature request: Decorators support #104
Comments
https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/babel-preset-app#readme Hope can support Decorators, then we can try it in vue project. |
The decorator spec unfortunately still seems like it's a long way off, both based on low activity and based on how many things it looks like they still have to figure out. The proposal has drifted pretty far from what the entire rest of the JavaScript ecosystem has been doing for many years. It also appears to be incompatible with a lot of the JavaScript ecosystem (e.g. no CommonJS support). So I'm not planning on supporting decorators based on the spec, at least not any time soon. Separate from that, decorators in TypeScript have been around for a while behind the |
nest.js is a great web framework but it's extremely slow during compilation. There are over 20 modules in my project. :( |
An initial implementation of TypeScript decorators has been released in version 0.4.10. You can read more about this in the release notes. Please let me know if you encounter any issues. |
I have a JS project, not TS. When compiling decorators, it throws errors:
|
Decorators are not a JS feature, so esbuild doesn't support them in JS. Nothing in the JS specification mentions decorators: https://262.ecma-international.org/12.0/. But they are a TS feature, so esbuild supports them in TS. You can tell esbuild to compile your JS as TS if you like: |
Thanks. I am now moving my project to TS and it works very well. |
Looks like decorators but without the metadata has moved to stage 3 and i am sure typescript will implement this in a while, what are your plans for javascript decorators support, @evanw |
My plans are to implement it after it has shipped in a browser, in node, or in TypeScript. This is the same thing that I do for all other syntax features. |
TypeScript implemented this on 5.0 beta https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#decorators |
Any plan to support decorators?
The text was updated successfully, but these errors were encountered: