Skip to content

Commit

Permalink
Merge pull request #19457 from patocallaghan/patoc/deprecate-ember-gl…
Browse files Browse the repository at this point in the history
…obal

Add deprecation for the Ember Global
  • Loading branch information
Chris Garrett authored Mar 18, 2021
2 parents 725cdf2 + 04f28b2 commit c2f5bed
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 c2f5bed

Please sign in to comment.