Ember-simple-auth: [DEPRECATION] Usage of the Ember Global is deprecated (Ember.libraries.register...)

Created on 14 Jun 2021  路  3Comments  路  Source: simplabs/ember-simple-auth

Description

This line here:
https://github.com/simplabs/ember-simple-auth/blob/1cca7aaed927e06efac7fcc5153cea3bc90832eb/packages/ember-simple-auth/index.js#L24
Is causing the following deprecation:

DEPRECATION: Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead. [deprecation id: ember-global] See https://deprecations.emberjs.com/v3.x/#toc_ember-global for more details.

Most helpful comment

We should probably go by the example of Ember Inspector, they don't use global Ember but use requireModule api instead.

https://github.com/emberjs/ember-inspector/blob/33b61245f6bef7adca44c262957bb171580fab9e/skeletons/web-extension/scripts/in-page-script.js#L32

All 3 comments

Is there any way to fix that without removing this code? I do not found a public replacement :thinking:

We should probably go by the example of Ember Inspector, they don't use global Ember but use requireModule api instead.

https://github.com/emberjs/ember-inspector/blob/33b61245f6bef7adca44c262957bb171580fab9e/skeletons/web-extension/scripts/in-page-script.js#L32

Ok, yes, it would be great if the above method could work (If Ember Simple Auth really needs to be registered at all)

For now, this blocks upgrade to Ember 3.27, with the following error message:

Uncaught ReferenceError: Ember is not defined at register-version.js:1
Ember.libraries.register('Ember Simple Auth', '3.1.0');

That said, Ember.libraries.register(libraryName, libraryVersion) still seems to be a part of the official docs of Ember 3.27, so I filed an issue regarding the documentation.

Was this page helpful?
0 / 5 - 0 ratings