From 04f28b234bd990e56bd3a93d7bb0485719f065e4 Mon Sep 17 00:00:00 2001 From: Pat O'Callaghan Date: Wed, 10 Mar 2021 21:38:30 +0000 Subject: [PATCH] Add deprecation for the Ember Global --- packages/@ember/-internals/bootstrap/index.js | 15 +++++++++++++++ .../test-cases/default-resolver-application.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/@ember/-internals/bootstrap/index.js b/packages/@ember/-internals/bootstrap/index.js index d74aee1c358..431992b2e55 100644 --- a/packages/@ember/-internals/bootstrap/index.js +++ b/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; @@ -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; }, }); diff --git a/packages/internal-test-helpers/lib/test-cases/default-resolver-application.js b/packages/internal-test-helpers/lib/test-cases/default-resolver-application.js index e67cc76d7c5..24d678a5bf6 100644 --- a/packages/internal-test-helpers/lib/test-cases/default-resolver-application.js +++ b/packages/internal-test-helpers/lib/test-cases/default-resolver-application.js @@ -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;