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

TS server significantly slower to initialize when includePackageJsonAutoImports is auto #60854

Open
OliverJAsh opened this issue Dec 25, 2024 · 0 comments

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Dec 25, 2024

🔎 Search Terms

  • monorepo
  • project references
  • package exports
  • subpath exports
  • includePackageJsonAutoImports
  • paths

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about auto imports.

⏯ Playground Link

No response

💻 Code

My large work project became significantly slower to initialize in VS Code after we migrated from paths in tsconfig.json to exports in package.json (6s before, 12s after).

I dug into the TS server log and noticed AutoImportProvider was now including many more files than before (2474 before, 8442 after).

This led me to typescript.preferences.includePackageJsonAutoImports, which I understand defaults to auto. When I set it to off, initialization time decreases from 12s back down to 6s. Note this doesn't seem to affect the functionality of auto imports.

I can't imagine this would be expected behaviour: 6s of extra initialization with no noticeable gain in functionality.

Unfortunately I can't share a reduced test case for this, but I would be happy to do further debugging if someone could give me guidance.

For context, this project is a monorepo with multiple packages depending on each other. We are also utilizing project references (each package has its own project). The package exports includes many entries.

🙁 Actual behavior

N/A

🙂 Expected behavior

N/A

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant