Skip to content

Commit

Permalink
Add deprecation for the Ember Global
Browse files Browse the repository at this point in the history
  • Loading branch information
patocallaghan committed Mar 18, 2021
1 parent 725cdf2 commit 04f28b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/@ember/-internals/bootstrap/index.js
@@ -1,5 +1,6 @@
import require from 'require';
import { context } from '@ember/-internals/environment';
import { deprecate } from '@ember/debug';

(function () {
let Ember;
Expand All @@ -13,6 +14,20 @@ import { context } from '@ember/-internals/environment';
Ember = require('ember').default;
}

deprecate(
'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.',
false,
{
id: 'ember-global',
until: '4.0.0',
url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global',
for: 'ember-source',
since: {
enabled: '3.27.0',
},
}
);

return Ember;
},
});
Expand Down
Expand Up @@ -12,7 +12,7 @@ export default class DefaultResolverApplicationTestCase extends AbstractApplicat
let application;
expectDeprecation(() => {
application = this.application = Application.create(this.applicationOptions);
}, /Using the globals resolver is deprecated/);
}, /(Using the globals resolver is deprecated|Usage of the Ember Global is deprecated)/);

// If the test expects a certain number of assertions, increment that number
let { assert } = QUnit.config.current;
Expand Down

0 comments on commit 04f28b2

Please sign in to comment.