microsoft / microsoft/TypeScript

Composite (-b) projects don't report duplicate compilations

Open
#39,146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Proposal Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 4.0.0-dev.20200615

Search Terms: type narrowing composite build project references duplicate compilations

Code

Expected behavior:

As determined in #38406, the above projects are misconfigured so that Wat.tsx is included twice in compilation (https://github.com/microsoft/TypeScript/issues/38406#issuecomment-625546420). There should be some indication that the projects are misconfigured.

Actual behavior:

Mysterious, difficult-to-debug inconsistencies in type narrowing during compile checking coupled with unusually slow builds.

Repository Link:
https://github.com/JoshuaKGoldberg/ts-repro-project-narrowing/tree/5b71a26b336e6b5267d919832e076923dbb38296

Related Issues: #38406

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked repro's tsconfig.base.json, tsconfig.json, src/a/tsconfig.json, and src/a/Wat.tsx, and compare its duplicate compilation behavior with the discussion in #38406. Trace the composite project-reference compilation and diagnostic entry points that handle repeated source inclusion. Done means the misconfiguration produces a clear indication instead of silent duplicate compilation and inconsistent narrowing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.