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

Move typescript compilation to esbuild and run babel on the output #859

Closed
jaredpalmer opened this issue Sep 17, 2020 · 1 comment
Closed
Labels
kind: feature New feature or request problem: stale Issue has not been responded to in some time solution: duplicate This issue or pull request already exists solution: wontfix This will not be worked on

Comments

@jaredpalmer
Copy link
Owner

Current Behavior

Tsdx doesn’t correctly transpile typescript thanks to upstream issues with Babel transform async to promises. The project appears to be dead.

Desired Behavior

Tsdx transpires typescript perfectly.

Suggested Solution

Write our own typescript rollup plugin that uses esbuild

Who does this impact? Who is this for?

Everyone

Describe alternatives you've considered

Additional context

I spoke with Evan You (inventor of Vue.js) privately about how he uses esbuild to power vite. He shared this technique with me. Basically, esbuild is really really really good and fast for typescript compilation. Its minifier, however, is significantly worse than terser according to Evan’s benchmarks. Thus, he suggested we implement it as a custom rollup plugin and keep the rest of the rollup pipeline for assets etc. Vite doesn’t use babel, however, we could still support it by running it after transpilation. Lastly, esbuild doesn’t type check, so we will want to take care of type checking on build and on watch.

On my phone right now, but this relates to several
open issues. Feel free to update this with more. #684 #795

@agilgur5
Copy link
Collaborator

agilgur5 commented Sep 17, 2020

Duplicate of #716, which I've already addressed in detail

Tsdx doesn’t correctly transpile typescript thanks to upstream issues with Babel transform async to promises. The project appears to be dead.

This is unrelated to ESBuild -- I don't believe it polyfills generators, it compiles async to generators as far as I know, sometimes incorrectly as well: evanw/esbuild#388.
#684 is also not a bug, but more a feature for support for polyfilling generators, which ESBuild does not do per above.

In any case that part similarly duplicates several existing issues and a PR. It is already being worked on and I've already responded to all the relevant issues and labeled them. It is slated to be fixed in v0.14.0 which I'm planning to release quite soon and am planning to finish #795 myself. Also not that many users are impacted by this bug, I've been tracking it for a while here and in microbundle.

Please search the issues before filing duplicates.

@agilgur5 agilgur5 added kind: feature New feature or request solution: duplicate This issue or pull request already exists solution: wontfix This will not be worked on labels Sep 17, 2020
@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label Oct 22, 2020
Repository owner locked as resolved and limited conversation to collaborators Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: feature New feature or request problem: stale Issue has not been responded to in some time solution: duplicate This issue or pull request already exists solution: wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants