Skip to content

Commit 16f96ee

Browse files
alan-agius4AndrewKushnir
authored andcommitted
refactor(compiler-cli): remove enableIvy options (angular#47346)
This option has no longer any effect as Ivy is the only rendering engine. BREAKING CHANGE: Angular compiler option `enableIvy` has been removed as Ivy is the only rendering engine. PR Close angular#47346
1 parent 1edb8e5 commit 16f96ee

File tree

20 files changed

+51
-96
lines changed

20 files changed

+51
-96
lines changed

devtools/tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
},
5353
"angularCompilerOptions": {
5454
"fullTemplateTypeCheck": true,
55-
"strictInjectionParameters": true,
56-
"enableIvy": true
55+
"strictInjectionParameters": true
5756
}
58-
}
57+
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export interface MiscOptions {
5858

5959
// @public
6060
export interface NgcCompatibilityOptions {
61-
enableIvy?: boolean | 'ngtsc';
6261
generateNgFactoryShims?: boolean;
6362
generateNgSummaryShims?: boolean;
6463
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "./tsconfig.app.json",
33
"angularCompilerOptions": {
4-
"enableIvy": true,
54
"i18nInFormat": "xmb"
65
}
76
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "./tsconfig.app.json",
33
"angularCompilerOptions": {
4-
"enableIvy": true,
54
"i18nInFormat": "xlf"
65
}
76
}

integration/ngcc/tsconfig-app.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
},
1414
"files": [
1515
"src/main.ts"
16-
],
17-
"angularCompilerOptions": {
18-
"enableIvy": "ngtsc"
19-
}
20-
}
16+
]
17+
}

packages/bazel/src/ngc-wrapped/index.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ export function compile({
232232
}
233233

234234
// Detect from compilerOpts whether the entrypoint is being invoked in Ivy mode.
235-
const isInIvyMode = !!compilerOpts.enableIvy;
236235
if (!compilerOpts.rootDirs) {
237236
throw new Error('rootDirs is not set!');
238237
}
@@ -259,16 +258,14 @@ export function compile({
259258
bazelHost = new CompilerHost(files, compilerOpts, bazelOpts, tsHost, fileLoader);
260259
}
261260

262-
if (isInIvyMode) {
263-
const delegate = bazelHost.shouldSkipTsickleProcessing.bind(bazelHost);
264-
bazelHost.shouldSkipTsickleProcessing = (fileName: string) => {
265-
// The base implementation of shouldSkipTsickleProcessing checks whether `fileName` is part of
266-
// the original `srcs[]`. For Angular (Ivy) compilations, ngfactory/ngsummary files that are
267-
// shims for original .ts files in the program should be treated identically. Thus, strip the
268-
// '.ngfactory' or '.ngsummary' part of the filename away before calling the delegate.
269-
return delegate(fileName.replace(/\.(ngfactory|ngsummary)\.ts$/, '.ts'));
270-
};
271-
}
261+
const delegate = bazelHost.shouldSkipTsickleProcessing.bind(bazelHost);
262+
bazelHost.shouldSkipTsickleProcessing = (fileName: string) => {
263+
// The base implementation of shouldSkipTsickleProcessing checks whether `fileName` is part of
264+
// the original `srcs[]`. For Angular (Ivy) compilations, ngfactory/ngsummary files that are
265+
// shims for original .ts files in the program should be treated identically. Thus, strip the
266+
// '.ngfactory' or '.ngsummary' part of the filename away before calling the delegate.
267+
return delegate(fileName.replace(/\.(ngfactory|ngsummary)\.ts$/, '.ts'));
268+
};
272269

273270
// By default, disable tsickle decorator transforming in the tsickle compiler host.
274271
// The Angular compilers have their own logic for decorator processing and we wouldn't
@@ -286,9 +283,7 @@ export function compile({
286283
// decorator transformation is still needed. This might be because of custom decorators
287284
// with the `@Annotation` JSDoc that will be processed by the tsickle decorator transform.
288285
// TODO: Figure out why this is needed in g3 and how we can improve this. FW-2225
289-
if (isInIvyMode) {
290-
bazelHost.transformDecorators = true;
291-
}
286+
bazelHost.transformDecorators = true;
292287
} else {
293288
compilerOpts.annotateForClosureCompiler = false;
294289
}

packages/compiler-cli/integrationtest/flat_module/tsconfig-build.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"angularCompilerOptions": {
33
"flatModuleId": "flat_module",
44
"flatModuleOutFile": "index.js",
5-
"skipTemplateCodegen": true,
6-
"enableIvy": false
5+
"skipTemplateCodegen": true
76
},
87

98
"compilerOptions": {

packages/compiler-cli/integrationtest/ngtools_src/tsconfig-build.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"angularCompilerOptions": {
3-
"debug": true,
4-
"enableIvy": false
3+
"debug": true
54
},
65

76
"compilerOptions": {

packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"angularCompilerOptions": {
3-
"skipTemplateCodegen": true,
4-
"enableIvy": false
3+
"skipTemplateCodegen": true
54
},
65

76
"compilerOptions": {

packages/compiler-cli/integrationtest/tsconfig-build.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"annotationsAs": "static fields",
55
"debug": true,
66
"enableSummariesForJit": true,
7-
"i18nFormat": "xlf",
8-
"enableIvy": false
7+
"i18nFormat": "xlf"
98
},
109

1110
"compilerOptions": {

0 commit comments

Comments
 (0)