Template type checking re-builds do not run correctly when referencing a re-exported type
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
- 領域
- build-system
調査の方向性
リンクされた最小再現から始め、指定された Angular と Node のバージョンで template type checking を有効にして ng serve を実行します。MyType を abc と abcd の定義の間で変更し、その後 Angular CLI の rebuild と template type checking のパスを調査します。型定義を元に戻すことで rebuild 時に template のエラーが削除されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Consider the following example, running ng serve with template type checking turned on:
- An Angular template references a property on the component class in an expression.
- This component class properties type definition comes from a file which re-exports the type definition from another file.
- Re-builds do not always re-compile the template expression when they should.
More specifically, in the reproduction repo this looks as follows:
- The app component template includes an expression:
{{ myType?.abc }}. - The app component class defines the myType property:
myType?: MyTypeReExported. - The type of the myType property comes from a file which re-exports another type.
export type MyTypeRexported = MyType. - The type MyType comes from a file which defines the definition as:
export interface MyType { abc: 123; }. - The initial ng serve will run without errors.
- Changing the type definition of MyType to be
export interface MyType { abcd: 123; }causes an error in the app component's template. This is seen in the re-build console output. This is the correct behaviour. - Changing the type definition back to what it was originally should remove the error. However, it does not. That is the bug.
Please provide a link to a minimal reproduction of the bug
https://github.com/HazzMan2409/angular-template-rebuild-bug
Please provide the environment you discovered this bug in
Angular 12.2.5.
Node 14.17.6
See the package.json on the repo for more details. At the time 12.2.5 was the latest version.
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 16時間 35分
- マージ済み PR(30日)
- 176
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
-
area: @angular/build gemini-triaged
難易度 4/5 3〜5日 初心者へのやさしさ 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 担当者 1 名 ·
angular/angular-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ontola/atomic-server#1625 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
melgarafael/DeskcommCRM#1451 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
bug via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bot:ai-assisted component:compact-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
midnightntwrk/midnight-sdk#403 ·