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

[DEPRECATION] Deprecates old browser support policy #19359

Merged
merged 1 commit into from
Jan 27, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ module.exports = {
let ember;
let targets = (this.project && this.project.targets && this.project.targets.browsers) || [];

if (targets.includes('ie 11')) {
this.ui.writeWarnLine(
'Internet Explorer 11 is listed in your compilation targets, but it will no longer be supported in the next major version of Ember. Please update your targets to remove IE 11 and include new targets that are within the updated support policy. For details on the new browser support policy, see:\n\n - The official documentation: http://emberjs.com/browser-support\n - the deprecation guide: https://emberjs.com/deprecations/v3.x#toc_3-0-browser-support-policy\n'
);
}

const isProduction = process.env.EMBER_ENV === 'production';

if (
Expand Down
5 changes: 5 additions & 0 deletions packages/@ember/-internals/browser-environment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import hasDom from './lib/has-dom';
declare const InstallTrigger: unknown;
declare const chrome: unknown;
declare const opera: unknown;
declare const MSInputMethodContext: unknown;
declare const documentMode: unknown;

export { default as hasDOM } from './lib/has-dom';
export const window = hasDom ? self : null;
Expand All @@ -11,3 +13,6 @@ export const history = hasDom ? self.history : null;
export const userAgent = hasDom ? self.navigator.userAgent : 'Lynx (textmode)';
export const isChrome = hasDom ? typeof chrome === 'object' && !(typeof opera === 'object') : false;
export const isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false;
export const isIE = hasDom
? typeof MSInputMethodContext !== 'undefined' && typeof documentMode !== 'undefined'
: false;
16 changes: 16 additions & 0 deletions packages/ember/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ import {

const Ember = (typeof context.imports.Ember === 'object' && context.imports.Ember) || {};

import { isIE } from '@ember/-internals/browser-environment';

deprecate(
'Internet Explorer 11 will no longer be supported in the next major version of Ember. For details on the new browser support policy, see the official documentation: http://emberjs.com/browser-support',
!isIE,
{
id: '3-0-browser-support-policy',
url: 'https://emberjs.com/deprecations/v3.x#toc_3-0-browser-support-policy',
until: '4.0.0',
for: 'ember-source',
since: {
enabled: '3.26.0',
},
}
);

Ember.isNamespace = true;
Ember.toString = function () {
return 'Ember';
Expand Down
8 changes: 7 additions & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@
EmberENV.ENABLE_OPTIONAL_FEATURES = true;
}

EmberENV['RAISE_ON_DEPRECATION'] = true;
var isIE = Boolean(window.MSInputMethodContext) && Boolean(document.documentMode);

// ignore deprecations for IE11 specifically (due to browser support
// policy deprecation, which happens before we can `expectDeprecation`)
if (!isIE) {
EmberENV['RAISE_ON_DEPRECATION'] = true;
}

if (QUnit.urlParams.debugrendertree) {
EmberENV['_DEBUG_RENDER_TREE'] = true;
Expand Down