From 5534e7f2d04d162229b94df120a7a9e1b6e31528 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Sat, 13 Feb 2021 15:26:05 -0500 Subject: [PATCH] [RFC#706]: Deprecate window.Ember and window.Em, which is an alias of window.Ember RFC: emberjs/rfcs#706 tl;dr: Recommend `import Ember from 'ember';` instead of using the window.Ember global --- packages/@ember/-internals/bootstrap/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/@ember/-internals/bootstrap/index.js b/packages/@ember/-internals/bootstrap/index.js index d74aee1c358..35de3b05929 100644 --- a/packages/@ember/-internals/bootstrap/index.js +++ b/packages/@ember/-internals/bootstrap/index.js @@ -1,4 +1,5 @@ import require from 'require'; +import { deprecate } from '@ember/debug'; import { context } from '@ember/-internals/environment'; (function () { @@ -9,6 +10,18 @@ import { context } from '@ember/-internals/environment'; enumerable: true, configurable: true, get() { + deprecate( + "Using window.Ember and window.Em have been deprecated. Use `import Ember from 'ember';` instead ", + false, + { + id: 'ember-source.window-global', + until: '4.0.0', + url: 'tbd', + for: 'ember-source', + since: { enabled: '3.26.0-beta.1' }, + } + ); + if (!Ember) { Ember = require('ember').default; }