question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation time grows with project size due to type-checking

See original GitHub issue

Current Behavior

When projects grow, transpilation time of TypeScript tends to grow with it because of the type checking. And while having types is awesome, especially when developing the longer compilation time is meh. Especially because most of the time your editor will tell you anyway that you messed up.

Desired Behavior

Possibility to opt out of type checking.

Suggested Solution

Add option (e.g. --transpileOnly) to skip type checking all together. This can be directly passed to the rollup plugin as an option. See docs.

In addition, we could also add a cli command that does only the type checking (e.g. tsdx typecheck). So people who are opted out, can still easily run diagnostics.

Who does this impact? Who is this for?

Everyone who runs into slow builds.

I tried to switch a project to tsdx and the build time grew to 6min (sometime I even got a heap overflow error from V8 … uuuuups). The project is very small, but the types seems to be very expensive. Removing type checking dropped the build time to 10s.

Describe alternatives you’ve considered

Not using tsdx and configuring rollup ourselves. Noooes!

Additional context

If this proposal sounds good, I am more than happy to work on it 🙂

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sw-yxcommented, Nov 4, 2019

i think we’d take a PR for this. good flag to have.

1reaction
sebaldcommented, Oct 18, 2019

@wessberg Yes, that was my proposal 🙂 I locally tried that and as mentioned it dropped build time to seconds (from minutes).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking down TypeScript project references | by Jake Ginnivan
TS-Jest is a great project for smaller typescript projects, but as the project size grows we need a different strategy.
Read more >
Angular CLI Strict Mode
Currently, Angular will not perform any type checking at compile-time. If you enable strictTemplates , Angular will check if todo has a ...
Read more >
A comprehensive guide to optimizing your Xcode build - Flexiple
This guide explores all possible ways to reduce Xcode build time. These optimizations are run against an open-source project to observe ...
Read more >
What happened with compilation times in c++20? : r/cpp - Reddit
On my last project, it took ~15 minutes for a clean build on a 64 core machine with 256GB ram and an NVMe...
Read more >
Our journey to type checking 4 million lines of Python - Dropbox
One of my ideas at the time was to also use type annotations to improve performance, by compiling the Python variant to C,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found