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

When using TypeScript 4.x, live-reload is much slower #1278

Closed
boris-petrov opened this issue Aug 25, 2020 · 7 comments
Closed

When using TypeScript 4.x, live-reload is much slower #1278

boris-petrov opened this issue Aug 25, 2020 · 7 comments
Labels
build Ideas for or bugs with the build process performance

Comments

@boris-petrov
Copy link

Some context could be found in Discord. TLDR is tsc --noEmit --watch finishes immediately, but ember serve takes a few seconds when a TS file changes. Running it with DEBUG=ember-cli-typescript* shows:

file changed helpers/create-immediate-value.ts
⠙ building...   ember-cli-typescript:typecheck-worker Typecheck starting +339ms
⠏ building...   ember-cli-typescript:typecheck-worker Typecheck complete (0 diagnostics) +5s

cc @dfreeman

@chriskrycho
Copy link
Member

Thank you for reporting!

@chriskrycho chriskrycho added build Ideas for or bugs with the build process performance labels Aug 31, 2020
@NullVoxPopuli
Copy link
Collaborator

Related: #1321

@andreyfel
Copy link

Hey guys! Any update on this? I also noticed the slowdown, so, decided to stay on TS@3.9 for now.
It is reproducible with e-c-t@4 as well.

@NullVoxPopuli
Copy link
Collaborator

In my own testing, I've noticed some slow down in Babel as well. :(

Swc can't come soon enough. :D

@dfreeman
Copy link
Member

@NullVoxPopuli Neither typescript@4 nor ember-cli-typescript@4 should impact your Babel compilation speed. The typescript package itself doesn't play a role in emit, and for ember-cli-typescript, the actual Babel plugins that are being set up didn't change between v3 and v4, just which package that responsibility lies with.

@dfreeman
Copy link
Member

I spent a little time with this this afternoon, and the performance characteristics of the compiler API we use to capture typechecking results seem to have changed in 4.0. Specifically, the version of that API that only tracks diagnostics has become much slower than the version that also tracks emitting files, which is a bit surprising to me.

I opened microsoft/TypeScript#40808, and we'll see if this is a bug and figure out where to go from there.

@boris-petrov
Copy link
Author

boris-petrov commented Oct 27, 2020

TypeScript 4.0.5 is out and this issue is fixed. Thanks to @dfreeman for resolving it with the TS guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Ideas for or bugs with the build process performance
Projects
None yet
Development

No branches or pull requests

5 participants