Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated window.ENV #18824

Merged
merged 1 commit into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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