Incremental builds miss diagnostics after UMD declaration changes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 44/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, typescript
- 領域
- build-system, testing
調査の方向性
Start with fileAffectsGlobalScope and the bound GlobalExports check described in the issue, then inspect the proposed fix in PR #64966. Reproduce the stale diagnostic with the four listed files and consecutive tsgo -p . --noLib --pretty false runs; compare with --incremental false. Done means the incremental build reports TS2322 after the declaration changes, with the CLI/watch tests and baselines passing.
索引モデルが issue の本文から書いたものです。
説明
🔎 Search Terms
UMD, export as namespace, incremental, stale diagnostics, affectsGlobalScope
🕗 Version & Regression Information
Reproduced with the Go compiler reporting 7.1.0-beta, built from microsoft/TypeScript commit 3e9236361fa97a9e6c685f4833ac457ae2d8c50a.
The first affected version has not been identified. The latest nightly has not been tested.
⏯ Playground Link
This requires consecutive compiler invocations that reuse .tsbuildinfo; a single Playground compilation does not reproduce it.
💻 Code
Create these four files in a new directory. The minimal library keeps the reproduction independent of installed standard-library files.
tsconfig.json:
{
"compilerOptions": {
"strict": true,
"incremental": true,
"noEmit": true,
"types": []
},
"include": ["*.ts"]
}
lib.d.ts:
interface Array<T> {}
interface Boolean {}
interface CallableFunction {}
interface Function {}
interface IArguments {}
interface NewableFunction {}
interface Number {}
interface Object {}
interface RegExp {}
interface String {}
umd.d.ts:
export as namespace UmdApi;
export interface Item { value: number }
client.ts:
declare const item: UmdApi.Item;
const checked: number = item.value;
-
Run the Go compiler from this directory, using an unpatched
tsgobinary:tsgo -p . --noLib --pretty falseThis succeeds and creates
tsconfig.tsbuildinfo. -
Change only
umd.d.tsto:export as namespace UmdApi; export interface Item { value: string } -
Repeat the same command, keeping the build-info file:
tsgo -p . --noLib --pretty false -
Compare with a compilation that disables incremental reuse:
tsgo -p . --noLib --pretty false --incremental false
🙁 Actual behavior
The second incremental build produces no diagnostics and exits with code 0, even though item.value is now a string and checked requires a number. client.ts has not changed.
Compiling the same files with --incremental false reports the error and exits with code 2:
client.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'.
A fresh directory containing the same edited inputs, without build-info, produces the same error.
🙂 Expected behavior
The incremental build should report TS2322, matching a fresh compilation of the same inputs.
Additional information about the issue
Proposed fix: https://github.com/microsoft/TypeScript/pull/64966
fileAffectsGlobalScope treats this declaration file as an external module without accounting for the global namespace introduced by export as namespace. As a result, changes to the declaration can leave cached diagnostics for unchanged global consumers intact. The proposed fix checks bound GlobalExports before the external-module early return.
The CLI reproduction above has been verified on the unpatched compiler. The PR's new CLI/watch framework tests and baselines remain pending; they have not been run successfully because required test dependencies are unavailable offline.
- 主要言語
- Go
- スター
- 112k
- フォーク
- 15.4k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 126
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TypeScript のほかの issue
-
Won't Fix
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/TypeScript#65107 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file location対応中かも @timurzvural が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/TypeScript#65087 ·
メンテナーはふだん 1 日以内に返信
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/TypeScript#64758 ·
メンテナーはふだん 1 日以内に返信
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`対応中かも @rajnish-verma-22172 が 12 日前に担当しました。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/TypeScript#64742 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindings対応中かも @dmety が 26 日前に担当しました。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/TypeScript#64661 ·
メンテナーはふだん 1 日以内に返信
microsoft/TypeScript の issue をすべて見る
似ている issue
-
[BUG] serviceenvupdater filter does not update KUBERNETES_SERVICE_HOST/PORT in init containers対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openyurtio/openyurt#2845 ·
メンテナーはふだん 7 日以内に返信
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
fix(scan): validate and normalize output format in validate-contract対応中かも @WKr1shna が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100