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

🐛 BUG: Extension is slow when using TypeScript 5.6 #970

Closed
Princesseuh opened this issue Oct 17, 2024 · 10 comments · Fixed by #973
Closed

🐛 BUG: Extension is slow when using TypeScript 5.6 #970

Princesseuh opened this issue Oct 17, 2024 · 10 comments · Fixed by #973
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) feat: perf Issue related to performance (scope)

Comments

@Princesseuh
Copy link
Member

Describe the Bug

TS 5.6 seems to have changed something, and now the extension is quite slow. Probably that https://github.com/volarjs/typescript-auto-import-cache requires an update for this.

Keeping this issue around as a refuge for fellow developers affected by this.

Steps to Reproduce

  1. Open an Astro project with TS 5.6 installed
  2. Make sure the extension is using the workspace's version, so that it uses 5.6 if your version of VS Code doesn't use 5.6 by default.
  3. Observe slowness.

Link to Minimal Reproducible Example

N/A. Any repo with the correct version is affected.

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 17, 2024
@alicercedigital
Copy link

Thank you very much for open this issue! We were having this issue in our project where every time we saved an .astro file, it took about 2 to 4 seconds to save. We were starting to think that Astro might struggle with larger or more "complex" projects, but after switching from TypeScript version 5.6.3 to 5.5.4, everything works fine now.

@Princesseuh Princesseuh added - P4: important Violate documented behavior or significantly improves performance (priority) feat: perf Issue related to performance (scope) and removed needs triage Issue needs to be triaged labels Oct 22, 2024
@oscar-corredor
Copy link

oscar-corredor commented Oct 22, 2024

Having this issue as well, reverting to 5.5.4 as suggested by @alicercedigital does help but it's not as fast as it was previously

@DrJume
Copy link

DrJume commented Oct 24, 2024

We have the same problem with Vue language tools, autocomplete inside Vue SFC files takes forever in a big monorepo project :(

@crazed-developer
Copy link

crazed-developer commented Oct 25, 2024

I'm hit severely with these performance problems, I'm fairly sure the issue are with the Astro extension. As i'm kind of able to remedy the issue. But with a caveat.

So in an astro file, i do a database search and intellisensing like this:
results[0]. <-- 12 seconds later i get intellisense on the object

If i then switch the language directly to Typescript from Astro, in the bottom right corner of the vscode window.

Then intellisense reacts so fast my finger on the . has not even left the key.

The caveat being that now the global Astro object are not recocnized with types. And return statements are regarded as errors, as they are not inside a function.

I'm having this issue on my two Macbook Pros

  • 2024 M3 36 GB
  • 2018 i9 32 GB

I hope this observation can help diagnose the problem.

Kind regards
Steffen

@johnsoncodehk
Copy link
Contributor

This issue should have been fixed by volarjs/typescript-auto-import-cache#6 and will be resolved with the next Astro extension release.

@Princesseuh
Copy link
Member Author

Unfortunately, it does not fix the issue. It makes it better, but there's still work to be done here. I suspect a fix is needed in Volar itself

@Princesseuh
Copy link
Member Author

volarjs/volar.js#242 seems to fix this, at least partially. It's massively faster (by 410ms on my computer), but further optimisations can most likely bring this lower.

@crazed-developer
Copy link

volarjs/volar.js#242 seems to fix this, at least partially. It's massively faster (by 410ms on my computer), but further optimisations can most likely bring this lower.

I hope for a quick release, thanks for your help!

@github-project-automation github-project-automation bot moved this from In Progress to Done in Backlogs Oct 25, 2024
@crazed-developer
Copy link

Update came through, tested in MBP 2018 i9, and it's very swift now! Thanks a lot!

@alicercedigital
Copy link

This problem keeps happening. We need to use TypeScript version 5.5.4 to work on the project. If we use any version above that, IntelliSense becomes very slow, taking several seconds to respond, and saving files also takes longer. With version 5.5.4, everything works fine.

We are currently using:

  • Astro version 5.0.9
  • Extension version v2.15.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority) feat: perf Issue related to performance (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants