Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4e99531

Browse files
alan-agius4filipesilva
authored andcommittedJun 30, 2020
fix(@schematics/angular): split browserslist IE entries and provide better comments
Closes #18032
1 parent c402c31 commit 4e99531

File tree

10 files changed

+27
-21
lines changed

10 files changed

+27
-21
lines changed
 

‎packages/schematics/angular/application/files/.browserslistrc.template

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ last 2 Edge major versions
1414
last 2 Safari major version
1515
last 2 iOS major versions
1616
Firefox ESR<% if (legacyBrowsers) { %>
17-
IE 9-11<% } else { %>
18-
not IE 9-11 # For IE 9-11 support, remove 'not'.<% } %>
17+
IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11.
18+
IE 11<% } else { %>
19+
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
20+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.<% } %>

‎packages/schematics/angular/application/index_spec.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,19 @@ describe('Application Schematic', () => {
445445
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
446446
.toPromise();
447447
const content = tree.readContent('/projects/foo/.browserslistrc');
448-
expect(content).not.toContain(`not IE 9-11 # For IE 9-11 support, remove 'not'.`);
449-
expect(content).toContain('IE 9-11');
448+
expect(content).not.toContain('not IE 11');
449+
expect(content).toContain('IE 11');
450+
451+
expect(content).not.toContain('not IE 9-10');
452+
expect(content).toContain('IE 9-10');
450453
});
451454

452455
it(`should not add support for IE 9-11 in '.browserslistrc' when 'legacyBrowsers' is false`, async () => {
453456
const options: ApplicationOptions = { ...defaultOptions, legacyBrowsers: false };
454457
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
455458
.toPromise();
456459
const content = tree.readContent('/projects/foo/.browserslistrc');
457-
expect(content).toContain(`not IE 9-11 # For IE 9-11 support, remove 'not'.`);
460+
expect(content).toContain('not IE 11');
461+
expect(content).toContain('not IE 9-10');
458462
});
459463
});

‎tests/legacy-cli/e2e/tests/build/differential-cache.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export default async function() {
4747
// Enable Differential loading to run both size checks
4848
await replaceInFile(
4949
'.browserslistrc',
50-
'not IE 9-11',
51-
'IE 9-11',
50+
'not IE 11',
51+
'IE 11',
5252
);
5353

5454
// Remove the cache so that an initial build and build with cache can be tested

‎tests/legacy-cli/e2e/tests/build/differential-loading.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default async function () {
88
// Enable Differential loading to run both size checks
99
await replaceInFile(
1010
'.browserslistrc',
11-
'not IE 9-11',
12-
'IE 9-11',
11+
'not IE 11',
12+
'IE 11',
1313
);
1414

1515
await writeMultipleFiles({

‎tests/legacy-cli/e2e/tests/build/polyfills.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default async function () {
1313
// Enable Differential loading to run both size checks
1414
await replaceInFile(
1515
'.browserslistrc',
16-
'not IE 9-11',
17-
'IE 9-11',
16+
'not IE 11',
17+
'IE 11',
1818
);
1919

2020
await ng('build', '--aot=false');

‎tests/legacy-cli/e2e/tests/build/prod-build.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export default async function () {
3939
// Enable Differential loading to run both size checks
4040
await replaceInFile(
4141
'.browserslistrc',
42-
'not IE 9-11',
43-
'IE 9-11',
42+
'not IE 11',
43+
'IE 11',
4444
);
4545

4646
await ng('build', '--prod');

‎tests/legacy-cli/e2e/tests/build/sourcemap.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default async function () {
66
// Enable Differential loading to run both size checks
77
await replaceInFile(
88
'.browserslistrc',
9-
'not IE 9-11',
10-
'IE 9-11',
9+
'not IE 11',
10+
'IE 11',
1111
);
1212

1313
// The below is needed to cache bundles and verify that sourcemaps are generated

‎tests/legacy-cli/e2e/tests/build/worker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default async function () {
1919
// Enable Differential loading to run both size checks
2020
await replaceInFile(
2121
'.browserslistrc',
22-
'not IE 9-11',
23-
'IE 9-11',
22+
'not IE 11',
23+
'IE 11',
2424
);
2525

2626
await ng('generate', 'web-worker', 'app');

‎tests/legacy-cli/e2e/tests/i18n/ivy-localize-dl-xliff2.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export async function executeTest() {
1616
// Ensure a DL build is used.
1717
await replaceInFile(
1818
'.browserslistrc',
19-
'not IE 9-11',
20-
'IE 9-11',
19+
'not IE 11',
20+
'IE 11',
2121
);
2222

2323
await updateJsonFile('tsconfig.base.json', config => {

‎tests/legacy-cli/e2e/tests/misc/browsers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default async function () {
1717

1818
await replaceInFile(
1919
'.browserslistrc',
20-
'not IE 9-11',
21-
'IE 9-11',
20+
'not IE 11',
21+
'IE 11',
2222
);
2323

2424
if (!getGlobalVariable('argv')['ve']) {

0 commit comments

Comments
 (0)
Please sign in to comment.