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

Resolve Ember Global deprecation #546

Closed
wants to merge 1 commit into from

Conversation

rmachielse
Copy link

@rmachielse rmachielse commented Jan 17, 2022

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.

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.
@rmachielse
Copy link
Author

@tombruijn I was already able to avoid this deprecation in our codebase by using installErrorHandler like this:

import Appsignal from '@appsignal/javascript';
import Ember from 'ember';
import { installErrorHandler } from '@appsignal/ember';

let appsignal = new Appsignal(...);

installErrorHandler(appsignal, Ember);

But I guess it would still be nice to avoid this deprecation here?
However I am not quite sure how to resolve the build errors.
The package name (ember-source) is different from the import name (ember) for example.

@unflxw unflxw self-assigned this Jan 24, 2022
@rmachielse
Copy link
Author

@tombruijn @unflxw any idea if and when you have some time to look into this?

@unflxw
Copy link
Contributor

unflxw commented Jan 27, 2022

Hi @rmachielse! I am looking into this. We'll add a change similar to the one you implemented, so that the default argument is obtained by importing Ember, and not by accessing window.Ember. The workaround you described, importing Ember and passing it as the second argument to installErrorHandler, will continue to work.

@rmachielse
Copy link
Author

@unflxw nice, thanks for that! Does that mean this pr can be closed?

@unflxw
Copy link
Contributor

unflxw commented Jan 27, 2022

@rmachielse Sure! I've created a separate issue #552 to track progress in fixing this. Thanks for reporting this and for the fix proposal!

@unflxw unflxw closed this Jan 27, 2022
@rmachielse
Copy link
Author

@unflxw thanks! Let me know if I can help or try out a potential fix 💪🏻

@unflxw
Copy link
Contributor

unflxw commented Feb 2, 2022

@rmachielse Hi again!

I attempted to fix the issue with the imports in your proposed PR, but couldn't figure it out. As seen in the workaround you submitted, it's possible to import Ember from 'ember' from app.js, from inside the Ember application -- but I don't think it's possible to do this from an external npm module that is brought in by ember-auto-import, which is how our Ember integration works. Maybe it's possible to do it as an Ember addon.

We may revisit this again in the future -- #552 is still in our backlog. For the time being, we have amended the documentation on our Ember integration, so that importing Ember from app.js is now the documented way to use AppSignal for Node.js with Ember.

Thank you so much for bringing this issue to our attention! Please let us know if you have any feedback about this decision. We'd be very interested to know if, as an Ember user, you've run into any issues derived from using the AppSignal integration in this way.

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

Successfully merging this pull request may close these issues.

2 participants