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

Type check is slow in incremental mode on watch mode's subsequent runs (not on the first run). #835

Open
EugeneGarbuzovPublic opened this issue Jan 10, 2024 · 0 comments
Labels

Comments

@EugeneGarbuzovPublic
Copy link

Current behavior

Type check is slow in incremental mode on watch mode's subsequent runs (not on the first run).

Expected behavior

Type check in incremental mode on watch mode's subsequent runs (not on the first run) has the same or comparable performance as in non-incremental mode.

Steps to reproduce the issue

  1. Set "incremental": true in tsconfig.
  2. Set build: true, mode: 'write-references' in fork-ts-checker options, as in the guide.
  3. Run pnpm start.
  4. After compilation and type check finish, modify src/index.tsx (e. g. add an empty comment) and save file.
  5. Note that after watch mode recompilation fork-ts-checker's type check finishes in approximately 2 seconds after compilation finishes. You may modify and save src/index.tsx multiple times to make sure.
  6. Stop pnpm start process.
  7. Remove "incremental": true from tsconfig, build: true, mode: 'write-references' from fork-ts-checker options.
  8. Repeat steps 3-4.
  9. Note that after watch mode recompilation fork-ts-checker's type check finishes within some milliseconds after compilation finishes. It looks as if it's almost immediate. You may modify and save src/index.tsx multiple times to make sure. Compare that to the results of step 5.

Please note that such a small value of 2 seconds is only on the reproduction repository. On a real-life project type check ends 35 seconds after compilation ends. After every file save.
At the same time without incremental mode type check finishes within a couple of seconds after compilation ends.

Is that the expected behaviour of incremental mode? Or is it a bug?

Issue reproduction repository

https://github.com/EugeneGarbuzovPublic/slow-incremental

Environment

  • fork-ts-checker-webpack-plugin: 9.0.2
  • typescript: 5.3.3
  • eslint: 8.56.0
  • webpack: 5.89.0
  • os: Windows 11 Pro 22H2 22621.2861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant