Skip to content

Commit ba8a6ea

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
feat(@schematics/angular): remove enableIvy option
With this change we remove the enableIvy option as now we only support generating Ivy application. Users who want to create a VE applications should follow the opt-out guide
1 parent e8e6f8a commit ba8a6ea

File tree

12 files changed

+28
-76
lines changed

12 files changed

+28
-76
lines changed

docs/design/analytics.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Note: There's a limit of 20 custom dimensions.
4848
| 5 | `Flag: --style` | `string` |
4949
| 6 | `--collection` | `string` |
5050
| 7 | `--buildEventLog` | `boolean` |
51-
| 8 | `Flag: --enableIvy` | `boolean` |
5251
| 9 | `Flag: --inlineStyle` | `boolean` |
5352
| 10 | `Flag: --inlineTemplate` | `boolean` |
5453
| 11 | `Flag: --viewEncapsulation` | `string` |

packages/schematics/angular/application/files/tsconfig.app.json.template

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,8 @@
77
"files": [
88
"src/main.ts",
99
"src/polyfills.ts"
10-
],<% if (!enableIvy) { %>
11-
"include": [
12-
"src/**/*.ts"
1310
],
14-
"exclude": [
15-
"src/test.ts",
16-
"src/**/*.spec.ts"
17-
]<% } %><% if (enableIvy) { %>
1811
"include": [
1912
"src/**/*.d.ts"
20-
],
21-
"angularCompilerOptions": {
22-
"enableIvy": true
23-
}<% } %>
13+
]
2414
}

packages/schematics/angular/application/files/tsconfig.spec.json.template

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@
1414
"include": [
1515
"src/**/*.spec.ts",
1616
"src/**/*.d.ts"
17-
]<% if (enableIvy) { %>,
18-
"angularCompilerOptions": {
19-
"enableIvy": true
20-
}<% } %>
17+
]
2118
}

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
194194
main: `${sourceRoot}/main.ts`,
195195
polyfills: `${sourceRoot}/polyfills.ts`,
196196
tsConfig: `${projectRoot}tsconfig.app.json`,
197-
aot: !!options.enableIvy,
197+
aot: true,
198198
assets: [
199199
`${sourceRoot}/favicon.ico`,
200200
`${sourceRoot}/assets`,

packages/schematics/angular/application/index_spec.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -213,45 +213,6 @@ describe('Application Schematic', () => {
213213
]));
214214
});
215215

216-
it('should set AOT option to false for VE projects', async () => {
217-
const options = { ...defaultOptions };
218-
219-
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
220-
.toPromise();
221-
const workspace = JSON.parse(tree.readContent('/angular.json'));
222-
expect(workspace.projects.foo.architect.build.options.aot).toEqual(false);
223-
});
224-
225-
it('should set AOT option to true for Ivy projects', async () => {
226-
const options = { ...defaultOptions, enableIvy: true };
227-
228-
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
229-
.toPromise();
230-
const workspace = JSON.parse(tree.readContent('/angular.json'));
231-
expect(workspace.projects.foo.architect.build.options.aot).toEqual(true);
232-
});
233-
234-
it('should set the right files, exclude, include in the tsconfig for VE projects', async () => {
235-
const tree = await schematicRunner.runSchematicAsync('application', defaultOptions, workspaceTree)
236-
.toPromise();
237-
const path = '/projects/foo/tsconfig.app.json';
238-
const tsConfig = JSON.parse(tree.readContent(path));
239-
expect(tsConfig.files).toEqual(['src/main.ts', 'src/polyfills.ts']);
240-
expect(tsConfig.exclude).toEqual(['src/test.ts', 'src/**/*.spec.ts']);
241-
expect(tsConfig.include).toEqual(['src/**/*.ts']);
242-
});
243-
244-
it('should set the right files, exclude, include in the tsconfig for Ivy projects', async () => {
245-
const options = { ...defaultOptions, enableIvy: true };
246-
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
247-
.toPromise();
248-
const path = '/projects/foo/tsconfig.app.json';
249-
const tsConfig = JSON.parse(tree.readContent(path));
250-
expect(tsConfig.files).toEqual(['src/main.ts', 'src/polyfills.ts']);
251-
expect(tsConfig.exclude).toBeUndefined();
252-
expect(tsConfig.include).toEqual(['src/**/*.d.ts']);
253-
});
254-
255216
describe(`update package.json`, () => {
256217
it(`should add build-angular to devDependencies`, async () => {
257218
const tree = await schematicRunner.runSchematicAsync('application', defaultOptions, workspaceTree)

packages/schematics/angular/application/schema.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
},
2020
"x-prompt": "What name would you like to use for the application?"
2121
},
22-
"enableIvy": {
23-
"description": "**EXPERIMENTAL** True to create a new app that uses the Ivy rendering engine.",
24-
"type": "boolean",
25-
"default": false,
26-
"x-user-analytics": 8
27-
},
2822
"inlineStyle": {
2923
"description": "When true, includes styles inline in the root component.ts file. Only CSS styles can be included inline. Default is false, meaning that an external styles file is created and referenced in the root component.ts file.",
3024
"type": "boolean",

packages/schematics/angular/ng-new/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export default function (options: NgNewOptions): Rule {
4646
const applicationOptions: ApplicationOptions = {
4747
projectRoot: '',
4848
name: options.name,
49-
enableIvy: options.enableIvy,
5049
inlineStyle: options.inlineStyle,
5150
inlineTemplate: options.inlineTemplate,
5251
prefix: options.prefix,

packages/schematics/angular/ng-new/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
},
1919
"x-prompt": "What name would you like to use for the new workspace and initial project?"
2020
},
21-
"enableIvy": {
22-
"description": "When true, creates a new app that uses the Ivy rendering engine.",
23-
"type": "boolean",
24-
"default": false
25-
},
2621
"skipInstall": {
2722
"description": "When true, does not install dependency packages.",
2823
"type": "boolean",

packages/schematics/angular/web-worker/index_spec.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ describe('Web Worker Schematic', () => {
7272
});
7373

7474
it('should add exclusions to tsconfig.app.json', async () => {
75+
const oldTsConfig = {
76+
extends: '../../tsconfig.json',
77+
include: [
78+
'src/**/*.ts',
79+
],
80+
exclude: [
81+
'src/test.ts',
82+
'src/**/*.spec.ts',
83+
],
84+
};
85+
appTree.overwrite('projects/bar/tsconfig.app.json', JSON.stringify(oldTsConfig, undefined, 2));
86+
7587
const tree = await schematicRunner.runSchematicAsync('web-worker', defaultOptions, appTree)
7688
.toPromise();
7789
const { exclude } = JSON.parse(tree.readContent('/projects/bar/tsconfig.app.json'));
@@ -120,7 +132,18 @@ describe('Web Worker Schematic', () => {
120132
const tsConfigPath = '/projects/bar/src/tsconfig.app.json';
121133
workspace.projects.bar.architect.build.options.tsConfig = tsConfigPath;
122134
appTree.overwrite('/angular.json', JSON.stringify(workspace));
123-
appTree.rename('projects/bar/tsconfig.app.json', tsConfigPath);
135+
136+
const oldTsConfig = {
137+
extends: '../../../tsconfig.json',
138+
include: [
139+
'**/*.ts',
140+
],
141+
exclude: [
142+
'test.ts',
143+
'**/*.spec.ts',
144+
],
145+
};
146+
appTree.create('projects/bar/src/tsconfig.app.json', JSON.stringify(oldTsConfig, undefined, 2));
124147

125148
const tree = await schematicRunner.runSchematicAsync('web-worker', defaultOptions, appTree)
126149
.toPromise();

tests/angular_devkit/build_angular/hello-world-app-ivy/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
"es2017",
1818
"dom"
1919
]
20-
},
21-
"angularCompilerOptions": {
22-
"enableIvy": true
2320
}
2421
}

tests/angular_devkit/build_ng_packagr/ng-packaged-ivy/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616
"es2017",
1717
"dom"
1818
]
19-
},
20-
"angularCompilerOptions": {
21-
"enableIvy": true
2219
}
2320
}

tests/legacy-cli/e2e/tests/ivy/ivy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { createProject, ngServe } from '../../utils/project';
1212

1313
export default async function() {
1414
try {
15-
await createProject('ivy-project', '--enable-ivy');
15+
await createProject('ivy-project');
1616

1717
// Add in a reference to a secondary entry-point to check that ngcc processes it correctly
1818
await replaceInFile(

0 commit comments

Comments
 (0)