From 2b6ed155e928b43ded071ada94bcb9562ff7e34d Mon Sep 17 00:00:00 2001 From: pshu Date: Tue, 11 Aug 2026 10:45:35 +0800 Subject: [PATCH 1/2] fix(tsconfig): stop reporting tsconfig files as file dependencies Temporary workaround for the memory burst in monorepos with project references. Restoring is a one-commit revert: uncomment the loop in `load_tsconfig_paths` and drop the `#[ignore]` on `tsconfig_file_as_file_dependencies`. --- src/lib.rs | 9 ++++++--- src/tests/tsconfig_project_references.rs | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b610ed06..6471a2a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1490,9 +1490,12 @@ impl ResolverGeneric { &tsconfig_options.references, ) .await?; - for dependency in &tsconfig.file_dependencies { - ctx.add_file_dependency(dependency.as_path()); - } + // TODO: restore once these can be reported without costing `module count * tsconfig count`. + // Temporarily disabled: a monorepo with project references bursts memory in the consumer, + // which keeps this set per module. See `tsconfig_file_as_file_dependencies`, ignored for now. + // for dependency in &tsconfig.file_dependencies { + // ctx.add_file_dependency(dependency.as_path()); + // } let paths = tsconfig.resolve(cached_path.path(), specifier); for path in paths { let cached_path = self.cache.value(&path); diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs index 6ea71e73..95b3c9cc 100644 --- a/src/tests/tsconfig_project_references.rs +++ b/src/tests/tsconfig_project_references.rs @@ -45,6 +45,8 @@ async fn auto() { } #[tokio::test] +#[ignore = "temporary workaround: tsconfig and its references are no longer reported as file dependencies, \ + because a monorepo with many project references bursts memory in the consumer"] async fn tsconfig_file_as_file_dependencies() { let f = super::fixture_root().join("tsconfig/cases/project_references"); From 8baf259936b5b082ec5c8f57c87a029b2934d691 Mon Sep 17 00:00:00 2001 From: pshu Date: Tue, 11 Aug 2026 10:53:58 +0800 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 6471a2a8..0ec572c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1492,7 +1492,8 @@ impl ResolverGeneric { .await?; // TODO: restore once these can be reported without costing `module count * tsconfig count`. // Temporarily disabled: a monorepo with project references bursts memory in the consumer, - // which keeps this set per module. See `tsconfig_file_as_file_dependencies`, ignored for now. + // which keeps this set per module. Trade-off: tsconfig edits won't invalidate watch builds. + // See `tsconfig_file_as_file_dependencies`, ignored for now. // for dependency in &tsconfig.file_dependencies { // ctx.add_file_dependency(dependency.as_path()); // }