-
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
transform API downgrades supported features when compared with build API #1423
Comments
The difference is probably that the build API is reading Here's a demonstration of the build API picking up
Here's a demonstration of passing
Edit: Also this is not "downgrading" since downgrading (i.e. transforming into equivalent syntax for older browsers) would imply that the code before and after are equivalent, which is not the case here. These two different outputs have different semantics. Doing The TypeScript compiler's default behavior is to transform the first form to the second which is bad because the behavior is different. But it's been broken for so long that the TypeScript team can't fix it because doing so would break a lot of real-world code. So instead they added the |
Thanks for the comment. This makes sense and apologies about the semantic looseness. I had briefly considered tsconfig as a source of differences but I tested for them poorly and eliminated it as a possibility. (passed I also eliminated it since I checked by config and it didn't have any options which esbuild was documented to care about, namely (I actually see you mentioned that PR in an old issue but instead of shipping as a breaking change it was stealth released in 4.3.1 it seems) Closing now since there doesn't seem to be any other action here. Thanks! |
I searched a few terms and couldn't find anything about if this is expected so posting an new issue.
Version: 0.12.15
Build API:
npx esbuild extension/options.ts --outdir=dist --target=chrome89
Transform API:
cat extension/options.ts | npx esbuild --loader=ts --target=chrome89 | less
That file has a some class fields like:
When using build API, this becomes the expected:
When using the transform API, this gets downgraded:
(Actual options.ts is here)
Is this difference expected? I mostly care about it since I usually use snowpack which uses the transform API first before applying optimizations using build API.
The text was updated successfully, but these errors were encountered: