Skip to content

Commit

Permalink
Merge pull request #18824 from btecu/cleanup
Browse files Browse the repository at this point in the history
Remove deprecated `window.ENV`
  • Loading branch information
locks authored Mar 22, 2020
2 parents e208961 + 13011f3 commit 8950fd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
20 changes: 2 additions & 18 deletions packages/@ember/-internals/environment/lib/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { deprecate } from '@ember/debug';
import { FUNCTION_PROTOTYPE_EXTENSIONS } from '@ember/deprecated-features';
import { DEBUG } from '@glimmer/env';
import global from './global';
Expand Down Expand Up @@ -106,8 +105,7 @@ export const ENV = {
This has to be set before the ember JavaScript code is evaluated. This is
usually done by setting `window.EmberENV = { _DEBUG_RENDER_TREE: true };`
or `window.ENV = { _DEBUG_RENDER_TREE: true };` before the "vendor"
`<script>` tag in `index.html`.
before the "vendor" `<script>` tag in `index.html`.
Setting the flag after Ember is already loaded will not work correctly. It
may appear to work somewhat, but fundamentally broken.
Expand Down Expand Up @@ -183,20 +181,6 @@ export const ENV = {
},
};

let providedEnv = global.EmberENV;
if (providedEnv === undefined) {
providedEnv = global.ENV;

deprecate(
"Configuring Ember's boot options via `window.ENV` is deprecated, please migrate to `window.EmberENV` instead.",
providedEnv === undefined,
{
id: 'ember-environment.window.env',
until: '3.17.0',
}
);
}

(EmberENV => {
if (typeof EmberENV !== 'object' || EmberENV === null) return;

Expand Down Expand Up @@ -256,7 +240,7 @@ if (providedEnv === undefined) {
if (DEBUG) {
ENV._DEBUG_RENDER_TREE = true;
}
})(providedEnv);
})(global.EmberENV);

export function getENV() {
return ENV;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ export default function addJQueryEventDeprecation(jqEvent) {
deprecate(
'Accessing jQuery.Event specific properties is deprecated. Either use the ember-jquery-legacy addon to normalize events to native events, or explicitly opt into jQuery integration using @ember/optional-features.',
(EmberENV => {
// this deprecation is intentionally checking `global.EmberENV` /
// `global.ENV` so that we can ensure we _only_ deprecate in the
// case where jQuery integration is enabled implicitly (e.g.
// "defaulted" to enabled) as opposed to when the user explicitly
// opts in to using jQuery
// this deprecation is intentionally checking `global.EmberENV` so
// that we can ensure we _only_ deprecate in the case where jQuery
// integration is enabled implicitly (e.g. "defaulted" to enabled)
// as opposed to when the user explicitly opts in to using jQuery
if (typeof EmberENV !== 'object' || EmberENV === null) return false;

return EmberENV._JQUERY_INTEGRATION === true;
})(global.EmberENV || global.ENV),
})(global.EmberENV),
{
id: 'ember-views.event-dispatcher.jquery-event',
until: '4.0.0',
Expand Down

0 comments on commit 8950fd4

Please sign in to comment.