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
Thank you for reporting!
Hey guys! Any update on this? I also noticed the slowdown, so, decided to stay on [email protected] for now.
It is reproducible with e-c-t@4 as well.
In my own testing, I've noticed some slow down in Babel as well. :(
Swc can't come soon enough. :D
@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.
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 https://github.com/microsoft/TypeScript/issues/40808, and we'll see if this is a bug and figure out where to go from there.
TypeScript 4.0.5 is out and this issue is fixed. Thanks to @dfreeman for resolving it with the TS guys!
Most helpful comment
TypeScript 4.0.5 is out and this issue is fixed. Thanks to @dfreeman for resolving it with the TS guys!