Skip to content

Commit

Permalink
[DEPRECATION] Deprecates old browser support policy
Browse files Browse the repository at this point in the history
* Adds the deprecation specified in
  https://github.com/emberjs/rfcs/blob/master/text/0685-new-browser-support-policy.md
* Updates the test harness to avoid failing CI for deprecations issued
  on IE11
  • Loading branch information
Chris Garrett authored and rwjblue committed Jan 27, 2021
1 parent 7ad44a6 commit fe48997
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
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
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) || {};

const isIE = Boolean(window.MSInputMethodContext) && Boolean(document.documentMode);

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

0 comments on commit fe48997

Please sign in to comment.