Skip to content

Commit 884111a

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): update IE unsupported and deprecation messages
IE 11 is no longer supported.
1 parent c3acf3c commit 884111a

File tree

2 files changed

+6
-63
lines changed

2 files changed

+6
-63
lines changed

packages/angular_devkit/build_angular/src/builders/browser/index.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -429,24 +429,10 @@ function checkInternetExplorerSupport(
429429
supportedBrowsers: string[],
430430
logger: logging.LoggerApi,
431431
): void {
432-
const hasIE9 = supportedBrowsers.includes('ie 9');
433-
const hasIE10 = supportedBrowsers.includes('ie 10');
434-
const hasIE11 = supportedBrowsers.includes('ie 11');
435-
436-
if (hasIE9 || hasIE10) {
437-
const browsers = (hasIE9 ? 'IE 9' + (hasIE10 ? ' & ' : '') : '') + (hasIE10 ? 'IE 10' : '');
438-
logger.warn(
439-
`Warning: Support was requested for ${browsers} in the project's browserslist configuration. ` +
440-
(hasIE9 && hasIE10 ? 'These browsers are' : 'This browser is') +
441-
' no longer officially supported with Angular v11 and higher.' +
442-
'\nFor more information, see https://v10.angular.io/guide/deprecations#ie-9-10-and-mobile',
443-
);
444-
}
445-
446-
if (hasIE11) {
432+
if (supportedBrowsers.some((b) => b === 'ie 9' || b === 'ie 10' || b === 'ie 11')) {
447433
logger.warn(
448-
`Warning: Support was requested for IE 11 in the project's browserslist configuration. ` +
449-
'IE 11 support is deprecated since Angular v12.' +
434+
`Warning: Support was requested for Internet Explorer in the project's browserslist configuration. ` +
435+
'Internet Explorer is no longer officially supported.' +
450436
'\nFor more information, see https://angular.io/guide/browser-support',
451437
);
452438
}

packages/angular_devkit/build_angular/src/builders/browser/specs/browser-support_spec.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Browser Builder browser support', () => {
2020
});
2121
afterEach(async () => host.restore().toPromise());
2222

23-
it('warns when IE9 is present in browserslist', async () => {
23+
it('warns when IE is present in browserslist', async () => {
2424
host.appendToFile('.browserslistrc', '\nIE 9');
2525

2626
const logger = new logging.Logger('');
@@ -31,52 +31,9 @@ describe('Browser Builder browser support', () => {
3131
const output = await run.result;
3232
expect(output.success).toBe(true);
3333

34-
const fullLog = logs.join();
35-
expect(fullLog).toContain(
36-
"Warning: Support was requested for IE 9 in the project's browserslist configuration.",
34+
expect(logs.join()).toContain(
35+
"Warning: Support was requested for Internet Explorer in the project's browserslist configuration",
3736
);
38-
expect(fullLog).toContain('This browser is ');
39-
40-
await run.stop();
41-
});
42-
43-
it('warns when IE10 is present in browserslist', async () => {
44-
host.appendToFile('.browserslistrc', '\nIE 10');
45-
46-
const logger = new logging.Logger('');
47-
const logs: string[] = [];
48-
logger.subscribe((e) => logs.push(e.message));
49-
50-
const run = await architect.scheduleTarget(targetSpec, undefined, { logger });
51-
const output = await run.result;
52-
expect(output.success).toBe(true);
53-
54-
const fullLog = logs.join();
55-
expect(fullLog).toContain(
56-
"Warning: Support was requested for IE 10 in the project's browserslist configuration.",
57-
);
58-
expect(fullLog).toContain('This browser is ');
59-
60-
await run.stop();
61-
});
62-
63-
it('warns when both IE9 & IE10 are present in browserslist', async () => {
64-
host.appendToFile('.browserslistrc', '\nIE 9-10');
65-
66-
const logger = new logging.Logger('');
67-
const logs: string[] = [];
68-
logger.subscribe((e) => logs.push(e.message));
69-
70-
const run = await architect.scheduleTarget(targetSpec, undefined, { logger });
71-
const output = await run.result;
72-
expect(output.success).toBe(true);
73-
74-
const fullLog = logs.join();
75-
expect(fullLog).toContain(
76-
"Warning: Support was requested for IE 9 & IE 10 in the project's browserslist configuration.",
77-
);
78-
expect(fullLog).toContain('These browsers are ');
79-
8037
await run.stop();
8138
});
8239
});

0 commit comments

Comments
 (0)