Skip to content

Commit f3c471e

Browse files
JeanMecheatscott
authored andcommitted
refactor(compiler): remove fullTemplateTypeCheck compiler option.
The option was deprecated back in v13. Users should use `strictTemplates: true`.
1 parent d45b7a9 commit f3c471e

33 files changed

Lines changed: 152 additions & 326 deletions

File tree

adev/src/content/reference/configs/angular-compiler-options.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,6 @@ For example, if a library uses the `public_api.ts` file as the library index of
130130
The `flatModuleOutFile` option could then be set, for example, to `"index.js"`, which produces `index.d.ts` and `index.metadata.json` files.
131131
The `module` field of the library's `package.json` would be `"index.js"` and the `typings` field would be `"index.d.ts"`.
132132

133-
### `fullTemplateTypeCheck`
134-
135-
When `true`, the recommended value, enables the binding expression validation phase of the template compiler. This phase uses TypeScript to verify binding expressions.
136-
For more information, see [Template type checking](tools/cli/template-typecheck).
137-
138-
Default is `false`, but when you use the Angular CLI command `ng new --strict`, it is set to `true` in the new project's configuration.
139-
140-
IMPORTANT: The `fullTemplateTypeCheck` option has been deprecated in Angular 13 in favor of the `strictTemplates` family of compiler options.
141-
142133
### `generateCodeForLibraries`
143134

144135
When `true`, creates factory files \(`.ngfactory.js` and `.ngstyle.js`\) for `.d.ts` files with a corresponding `.metadata.json` file. The default value is `true`.

adev/src/content/tools/cli/aot-compiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ And it does not interfere with the ES module's exported API.
369369
One of the Angular compiler's most helpful features is the ability to type-check expressions within templates, and catch any errors before they cause crashes at runtime.
370370
In the template type-checking phase, the Angular template compiler uses the TypeScript compiler to validate the binding expressions in templates.
371371

372-
Enable this phase explicitly by adding the compiler option `"fullTemplateTypeCheck"` in the `"angularCompilerOptions"` of the project's TypeScript configuration file
372+
Enable this phase explicitly by adding the compiler option `"strictTemplates"` in the `"angularCompilerOptions"` of the project's TypeScript configuration file
373373
(see [Angular Compiler Options](reference/configs/angular-compiler-options)).
374374

375375
Template validation produces error messages when a type error is detected in a template binding

goldens/public-api/compiler-cli/compiler_options.api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ export interface LegacyNgcOptions {
5050
allowEmptyCodegenFiles?: boolean;
5151
flatModuleId?: string;
5252
flatModuleOutFile?: string;
53-
// @deprecated
54-
fullTemplateTypeCheck?: boolean;
5553
preserveWhitespaces?: boolean;
5654
strictInjectionParameters?: boolean;
5755
}

integration/cli-hello-world-ivy-i18n/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"lib": ["es2018", "dom"]
1515
},
1616
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
1817
"strictInjectionParameters": true
1918
}
2019
}

integration/cli-hello-world-lazy/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"lib": ["es2018", "dom"]
1515
},
1616
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
1817
"strictInjectionParameters": true
1918
}
2019
}

integration/defer/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"lib": ["es2018", "dom"]
1515
},
1616
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
1817
"strictInjectionParameters": true
1918
}
2019
}

integration/legacy-animations-async/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"lib": ["es2018", "dom"]
1616
},
1717
"angularCompilerOptions": {
18-
"fullTemplateTypeCheck": true,
1918
"strictInjectionParameters": true
2019
}
2120
}

integration/legacy-animations/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"lib": ["es2018", "dom"]
1515
},
1616
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
1817
"strictInjectionParameters": true
1918
}
2019
}

integration/standalone-bootstrap/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"lib": ["es2018", "dom"]
1515
},
1616
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
1817
"strictInjectionParameters": true
1918
}
2019
}

packages/compiler-cli/src/ngtsc/core/api/src/public_options.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@ export interface LegacyNgcOptions {
2323
*/
2424
allowEmptyCodegenFiles?: boolean;
2525

26-
/**
27-
* Whether to type check the entire template.
28-
*
29-
* This flag currently controls a couple aspects of template type-checking, including
30-
* whether embedded views are checked.
31-
*
32-
* For maximum type-checking, set this to `true`, and set `strictTemplates` to `true`.
33-
*
34-
* It is an error for this flag to be `false`, while `strictTemplates` is set to `true`.
35-
*
36-
* @deprecated The `fullTemplateTypeCheck` option has been superseded by the more granular
37-
* `strictTemplates` family of compiler options. Usage of `fullTemplateTypeCheck` is therefore
38-
* deprecated, `strictTemplates` and its related options should be used instead.
39-
*/
40-
fullTemplateTypeCheck?: boolean;
41-
4226
/**
4327
* Whether to generate a flat module index of the given name and the corresponding
4428
* flat module metadata. This option is intended to be used when creating flat
@@ -100,8 +84,6 @@ export interface TypeCheckingOptions {
10084
/**
10185
* If `true`, implies all template strictness flags below (unless individually disabled).
10286
*
103-
* This flag is a superset of the deprecated `fullTemplateTypeCheck` option.
104-
*
10587
* Defaults to `true`
10688
*/
10789
strictTemplates?: boolean;
@@ -115,15 +97,15 @@ export interface TypeCheckingOptions {
11597
* directive or component is receiving the binding. If set to `true`, both sides of the assignment
11698
* are checked.
11799
*
118-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
100+
* Defaults to `false`.
119101
*/
120102
strictInputTypes?: boolean;
121103

122104
/**
123105
* Whether to check if the input binding attempts to assign to a restricted field (readonly,
124106
* private, or protected) on the directive/component.
125107
*
126-
* Defaults to `false`, even if "fullTemplateTypeCheck", "strictTemplates" and/or
108+
* Defaults to `false`, even if "strictTemplates" and/or
127109
* "strictInputTypes" is set. Note that if `strictInputTypes` is not set, or set to `false`, this
128110
* flag has no effect.
129111
*
@@ -140,7 +122,7 @@ export interface TypeCheckingOptions {
140122
* binding expressions are wrapped in a non-null assertion operator to effectively disable strict
141123
* null checks.
142124
*
143-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set. Note that if `strictInputTypes` is
125+
* Defaults to `false`. Note that if `strictInputTypes` is
144126
* not set, or set to `false`, this flag has no effect.
145127
*/
146128
strictNullInputTypes?: boolean;
@@ -154,7 +136,7 @@ export interface TypeCheckingOptions {
154136
* without a value, so with this flag set to `true`, an error would be reported. If set to
155137
* `false`, text attributes will never report an error.
156138
*
157-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set. Note that if `strictInputTypes` is
139+
* Defaults to `false`. Note that if `strictInputTypes` is
158140
* not set, or set to `false`, this flag has no effect.
159141
*/
160142
strictAttributeTypes?: boolean;
@@ -166,7 +148,7 @@ export interface TypeCheckingOptions {
166148
* then the return type of `a?.b` for example will be the same as the type of the ternary
167149
* expression `a != null ? a.b : a`.
168150
*
169-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
151+
* Defaults to `false`.
170152
*/
171153
strictSafeNavigationTypes?: boolean;
172154

@@ -177,7 +159,7 @@ export interface TypeCheckingOptions {
177159
* determined by the type of `document.createElement` for the given DOM node. If set to `false`,
178160
* the type of `ref` for DOM nodes will be `any`.
179161
*
180-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
162+
* Defaults to `false`.
181163
*/
182164
strictDomLocalRefTypes?: boolean;
183165

@@ -189,7 +171,7 @@ export interface TypeCheckingOptions {
189171
* `EventEmitter`/`Subject` of the output. If set to `false`, the `$event` variable will be of
190172
* type `any`.
191173
*
192-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
174+
* Defaults to `false`.
193175
*/
194176
strictOutputEventTypes?: boolean;
195177

@@ -200,7 +182,7 @@ export interface TypeCheckingOptions {
200182
* `HTMLElementEventMap`, with a fallback to the native `Event` type. If set to `false`, the
201183
* `$event` variable will be of type `any`.
202184
*
203-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
185+
* Defaults to `false`.
204186
*/
205187
strictDomEventTypes?: boolean;
206188

@@ -213,15 +195,15 @@ export interface TypeCheckingOptions {
213195
* will be included in the context type for the template. If `false`, any generic parameters will
214196
* be set to `any` in the template context type.
215197
*
216-
* Defaults to `false`, even if "fullTemplateTypeCheck" is set.
198+
* Defaults to `false`.
217199
*/
218200
strictContextGenerics?: boolean;
219201

220202
/**
221203
* Whether object or array literals defined in templates use their inferred type, or are
222204
* interpreted as `any`.
223205
*
224-
* Defaults to `false` unless `fullTemplateTypeCheck` or `strictTemplates` are set.
206+
* Defaults to `false` unless `strictTemplates` is set.
225207
*/
226208
strictLiteralTypes?: boolean;
227209
}

0 commit comments

Comments
 (0)