You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This particular translation causes problems with esbuild and esbuild-based frameworks like vite.
esbuild does not support TypeScript's emitDecoratorMetadata functionality, so we must use this brilliant Babel plugin to inject the missing metadata before running esbuild.
On the other hand, esbuild can handle TypeScript's parameter decorators perfectly well. Internally, esbuild does the same kind of translation as this Babel plugin + @babel/plugin-proposal-decorators (in legacy mode), but implemented differently.
But if this Babel plugin translates parameter decorators to function expressions, and the result is fed to esbuild, then esbuild errors out.
Therefore, could you please add an option to disable the translation of parameter decorators?
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks @leonardfactory! But, now that I think about it, maybe a better solution is to translate parameter decorators in a way that does not confuse esbuild, by avoiding function expressions.
For example, let's say I start with this:
Then, you won't need to offer any options for configuring this plugin.
And also, derivative projects like https://github.com/intellild/babel-plugin-transform-typescript-metadata won't need to implement their own configuration mechanism for turning off this specific translation.
What do you think? :)
This particular translation causes problems with esbuild and esbuild-based frameworks like vite.
esbuild does not support TypeScript's
emitDecoratorMetadata
functionality, so we must use this brilliant Babel plugin to inject the missing metadata before running esbuild.On the other hand, esbuild can handle TypeScript's parameter decorators perfectly well. Internally, esbuild does the same kind of translation as this Babel plugin +
@babel/plugin-proposal-decorators
(in legacy mode), but implemented differently.But if this Babel plugin translates parameter decorators to function expressions, and the result is fed to esbuild, then esbuild errors out.
Therefore, could you please add an option to disable the translation of parameter decorators?
Thanks!
The text was updated successfully, but these errors were encountered: