Template type checking re-builds do not run correctly when referencing a re-exported type
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 14h 23m
- PR unite (30g)
- 162
Descrizione
### 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
```true
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.
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con la riproduzione minima collegata ed esegui ng serve con il controllo dei tipi dei template abilitato sulle versioni di Angular e Node indicate. Cambia MyType tra le definizioni abc e abcd, quindi esamina i percorsi di rebuild di Angular CLI e di controllo dei tipi dei template. Il lavoro è completato quando il ripristino della definizione del tipo rimuove l'errore del template durante il rebuild.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100