Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular-devkit/build-angular): update IE unsupported and deprecation messages #21835

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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();
});
});