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
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? 🙂
The text was updated successfully, but these errors were encountered:
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 theemitDecoratorMetadata
tsc featureemitDecoratorMetadata
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 introducetsyringe
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 usestsyringe
in a way that does not depend on the single location wheretsyringe
accesses the metadata emitted by tsc whenemitDecoratorMetadata
istrue
, 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 intsconfig
, with a link to esbuild's docs stating thatemitDecoratorMetadata
is not supported. Would that be welcome? 🙂The text was updated successfully, but these errors were encountered: