Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): update IE unsupported and depreca…
Browse files Browse the repository at this point in the history
…tion messages

IE 11 is no longer supported.
  • Loading branch information
alan-agius4 authored and clydin committed Sep 29, 2021
1 parent c3acf3c commit 884111a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 63 deletions.
Expand Up @@ -429,24 +429,10 @@ function checkInternetExplorerSupport(
supportedBrowsers: string[],
logger: logging.LoggerApi,
): void {
const hasIE9 = supportedBrowsers.includes('ie 9');
const hasIE10 = supportedBrowsers.includes('ie 10');
const hasIE11 = supportedBrowsers.includes('ie 11');

if (hasIE9 || hasIE10) {
const browsers = (hasIE9 ? 'IE 9' + (hasIE10 ? ' & ' : '') : '') + (hasIE10 ? 'IE 10' : '');
logger.warn(
`Warning: Support was requested for ${browsers} in the project's browserslist configuration. ` +
(hasIE9 && hasIE10 ? 'These browsers are' : 'This browser is') +
' no longer officially supported with Angular v11 and higher.' +
'\nFor more information, see https://v10.angular.io/guide/deprecations#ie-9-10-and-mobile',
);
}

if (hasIE11) {
if (supportedBrowsers.some((b) => b === 'ie 9' || b === 'ie 10' || b === 'ie 11')) {
logger.warn(
`Warning: Support was requested for IE 11 in the project's browserslist configuration. ` +
'IE 11 support is deprecated since Angular v12.' +
`Warning: Support was requested for Internet Explorer in the project's browserslist configuration. ` +
'Internet Explorer is no longer officially supported.' +
'\nFor more information, see https://angular.io/guide/browser-support',
);
}
Expand Down
Expand Up @@ -20,7 +20,7 @@ describe('Browser Builder browser support', () => {
});
afterEach(async () => host.restore().toPromise());

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

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

const fullLog = logs.join();
expect(fullLog).toContain(
"Warning: Support was requested for IE 9 in the project's browserslist configuration.",
expect(logs.join()).toContain(
"Warning: Support was requested for Internet Explorer in the project's browserslist configuration",
);
expect(fullLog).toContain('This browser is ');

await run.stop();
});

it('warns when IE10 is present in browserslist', async () => {
host.appendToFile('.browserslistrc', '\nIE 10');

const logger = new logging.Logger('');
const logs: string[] = [];
logger.subscribe((e) => logs.push(e.message));

const run = await architect.scheduleTarget(targetSpec, undefined, { logger });
const output = await run.result;
expect(output.success).toBe(true);

const fullLog = logs.join();
expect(fullLog).toContain(
"Warning: Support was requested for IE 10 in the project's browserslist configuration.",
);
expect(fullLog).toContain('This browser is ');

await run.stop();
});

it('warns when both IE9 & IE10 are present in browserslist', async () => {
host.appendToFile('.browserslistrc', '\nIE 9-10');

const logger = new logging.Logger('');
const logs: string[] = [];
logger.subscribe((e) => logs.push(e.message));

const run = await architect.scheduleTarget(targetSpec, undefined, { logger });
const output = await run.result;
expect(output.success).toBe(true);

const fullLog = logs.join();
expect(fullLog).toContain(
"Warning: Support was requested for IE 9 & IE 10 in the project's browserslist configuration.",
);
expect(fullLog).toContain('These browsers are ');

await run.stop();
});
});

0 comments on commit 884111a

Please sign in to comment.