Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Deprecation warning ember-getowner-polyfill.import #15

Closed
janmisek opened this issue Dec 14, 2016 · 19 comments
Closed

Deprecation warning ember-getowner-polyfill.import #15

janmisek opened this issue Dec 14, 2016 · 19 comments

Comments

@janmisek
Copy link

Hello

I am getting deprecation warning ember-getowner-polyfill.import caused by addons using the polyfill as caret dependency ^. I am currently on ember 2.9.1 and I like to keep app clean of deprecations. Even because of clean console. Is there any solution for this?

I am now using following workaround after npm install:

find node_modules -type d -name ember-getowner-polyfill | xargs rm -fr
npm install [email protected]

Thanks in advance

@janmisek
Copy link
Author

janmisek commented Dec 19, 2016

Currently I am using following workaround to get rid of deprecation warning. Its part of my install pipe and basically it installs everything then remove latest ember-getowner-polyfill and forces installation of 1.0.1 version which does not include deprecation warning.

find node_modules -type d -name ember-getowner-polyfill | xargs rm -fr
npm install [email protected]

@Dhaulagiri
Copy link

@janmisek you may already be familiar with it, but I really like using ember-cli-deprecation-workflow for these situations where I can't get rid of a deprecation due to upstream issues in addons but I also don't want to see it in the console

@rwjblue
Copy link
Member

rwjblue commented Feb 2, 2017

Indeed, thanks for chiming in here!

@Turbo87
Copy link
Contributor

Turbo87 commented Feb 4, 2017

it should also be mentioned that the best way to resolve this is opening PRs on the addons and resolving the deprecation issue!

@rwjblue
Copy link
Member

rwjblue commented Feb 4, 2017

Confirm

@janmisek
Copy link
Author

janmisek commented Feb 6, 2017

I agree and I also like deprecation workflow. But I think in this particular case versioning is responsible. Like deprecation is upcoming bc therefore deprecation should not be considered as minor change considering that most of the addons link the module as ^

@bluscreen
Copy link

bluscreen commented Mar 6, 2017

I'm also suffering from this warning as well as htmlsafe-polyfill in ember 2.11

DEPRECATION: ember-string-ishtmlsafe-polyfill is now a true polyfill. Use Ember.String.isHTMLSafe directly instead of importing from ember-string-ishtmlsafe-polyfill [deprecation id: ember-string-ishtmlsafe-polyfill.import]

DEPRECATION: ember-getowner-polyfill is now a true polyfill. Use Ember.getOwner directly instead of importing from ember-getowner-polyfill [deprecation id: ember-getowner-polyfill.import]

does anybody know how to actually cure them? i cant find any direct references in my project for including them...

@workmanw
Copy link

workmanw commented Mar 6, 2017

@bluscreen I suspect you're using an addon that is using the polyfill. I'm not sure if it's possible, but we should only throw this deprecation if the app is directly using it. Or perhaps we should not even throw the deprecation at all.

@bluscreen
Copy link

bluscreen commented Mar 6, 2017

i personally would say that it's not really such a critical thing to still have them included in some plugins..

Update:
when i get these warnings in IE 11 with console open the page will stop working... can you please remove these warnings or let me know how to find out which dependencies are using it? :/

@bcardarella
Copy link

it should also be mentioned that the best way to resolve this is opening PRs on the addons and resolving the deprecation issue!

@Turbo87 the problem with this is that some of the more popular addons are not in any hurry to move away from the polyfill. They want to support the entire 2.x major version cycle.

@Turbo87
Copy link
Contributor

Turbo87 commented Apr 19, 2017

@bcardarella I wasn't suggesting to remove the polyfill, just to update it to the latest version where you don't have to import it explicitly which creates the deprecation message above.

@rwjblue
Copy link
Member

rwjblue commented Apr 19, 2017

Yes, the current version of the polyfill is a true polyfill. You use the exact same API that you would use on newer Ember versions.

@Turbo87
Copy link
Contributor

Turbo87 commented Apr 19, 2017

@bcardarella I suppose what you're actually commenting on is the situation described in #16, right?

@bcardarella
Copy link

bcardarella commented Apr 19, 2017

Its more about the necessity for this particular addon to put the burden of the warning upon the application consumer. Whereas it is really meant for the addon developer that directly consumes it. The app developer has little recourse for resolving the warning if the addon developer is unable or unwilling to upgrade or resolve. Yet they are the one who constantly have to see the message.

@bcardarella
Copy link

The irony however, is that even if the warning was removed or somehow made so that it only shows while developing the addon, there would still need to be an update made which puts us back at square one. So I'm hoping that in the future when it comes to something like this in Ember there can be an easier course of action to not impact app developers as much

@bcardarella
Copy link

Also, I think it would be helpful if somehow deprecation warnings could notify which addon is the one offending. Doing npm ls to search for the dependency doesn't give reliable results on which addon depends on ember-getowner-polyfill. Considering how many addons use it, and tracking down which ones are not using it correctly, is difficult.

Perhaps this is something that the EmberObserver folks can help with? If they're already doing some sort of static analysis on each addon perhaps they can help track down the ones that are still importing this addon and we can try and push those addon developers to updating?

@rwjblue
Copy link
Member

rwjblue commented Apr 19, 2017

EmberObserver has code search built in, there are 49 addons that have from 'ember-getowner-polyfill' in them (see here).

@rwjblue
Copy link
Member

rwjblue commented Apr 19, 2017

Also, I think it would be helpful if somehow deprecation warnings could notify which addon is the one offending.

FWIW, there is no way to know the "referrer" of an import. It is possible to add that (ember-cli/loader.js#118 makes it a bit easier), but it doesn't exist today.

@rwjblue
Copy link
Member

rwjblue commented Jul 28, 2017

The deprecation has been removed and published in 2.0.0.

@rwjblue rwjblue closed this as completed Jul 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants