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

Deprecate window.ENV #18413

Closed
chancancode opened this issue Sep 19, 2019 · 2 comments
Closed

Deprecate window.ENV #18413

chancancode opened this issue Sep 19, 2019 · 2 comments

Comments

@chancancode
Copy link
Member

We should only use window.EmberENV (usage of window.ENV is discouraged, and only exists as a form of legacy support). I’ll do a separate PR to add a deprecation if we find and use window.ENV.

- @rwjblue in #18372

@rwjblue
Copy link
Member

rwjblue commented Sep 20, 2019

The basic idea here is to refactor this:

})(global.EmberENV || global.ENV);

To check if we are falling back to global.ENV and issue a deprecation if we do. Something like:

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 => {
  // ...snip IIFE contents...
})(providedEnv);

@rwjblue
Copy link
Member

rwjblue commented Oct 1, 2019

Closed by #18441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants