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

esbuild should emit a warning when emitDecoratorMetadata is found in tsconfig #3680

Open
Cldfire opened this issue Mar 6, 2024 · 0 comments

Comments

@Cldfire
Copy link

Cldfire commented Mar 6, 2024

I am nearing the end of a multi-month long effort to port a large, old production build system from 4-5 separate Webpack/Rollup configs to a single esbuild config.

Throughout these efforts I have been carefully exploring, iterating, and checking that both at buildtime and runtime things are working out and esbuild is satisfying the needs of our existing codebase without major modifications. Things have been going well, and I've been able to make small changes where necessary to accommodate the lack of type information / tsc.

Tonight I was very worried to discover that:

  • tsyringe relies on the emitDecoratorMetadata tsc feature
  • esbuild does not support emitDecoratorMetadata

I came across some discussion about tsyringe and esbuild online, which is the first I've realized that they won't necessarily play well together (I didn't introduce tsyringe into this codebase and I've never used it before, so I wasn't familiar with what it required). I've been building and using the built outputs from esbuild without issue for over a month now, so it was concerning to discover this potential runtime problem this late in the porting process. I spent the last 4 hours doing a lot of reading / discovery, and I've been able to fairly confidently prove that our codebase uses tsyringe in a way that does not depend on the single location where tsyringe accesses the metadata emitted by tsc when emitDecoratorMetadata is true, but I really would have preferred to have found out about this much earlier.

I would like to open a PR that would cause esbuild to emit a warning at build time when emitDecoratorMetadata is found in tsconfig, with a link to esbuild's docs stating that emitDecoratorMetadata is not supported. Would that be welcome? 🙂

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

1 participant