ember-modal-dialog icon indicating copy to clipboard operation
ember-modal-dialog copied to clipboard

Remove computed-property.override deprecation

Open tniezurawski opened this issue 6 years ago • 5 comments
trafficstars

I see this deprecation since Ember 3.9.0:

DEPRECATION: The <my-app@component:ember-modal-dialog/-tether-dialog::ember4138>#targetAttachmentClass computed property was just overriden. This removes the computed property and replaces it with a plain value, and has been deprecated. If you want this behavior, consider defining a setter which does it manually. [deprecation id: computed-property.override] See https://emberjs.com/deprecations/v3.x#toc_computed-property-override for more details.

I tried to identify where targetAttachmentClass was overridden but I can't find it 🤷‍♂ Any clue?

tniezurawski avatar Aug 23 '19 14:08 tniezurawski

This has to do with a function somewhere in the code. If someone can walk me through it I'd be glad to write the PR. If you search if (this._ in this repo, it's what most closely resembles the message in the deprecation. I'm wondering if it is a reason my image popups stopped working. Let's get this fixed y'all!

jameshahn2 avatar Sep 17 '19 02:09 jameshahn2

Hi @jameshahn2, the reason for this error is that targetAttachmentClass is a computed property. If a value is passed in for the property, Ember's historical behavior is that the passed value would replace the computed function. This is now deprecated, hence the warning. So we need a new way to provide a default value for targetAttachmentClass. I think that a way to do it would be to make the init method of the component(s) set targetAttachmentClass if and only if this.targetAttachmentClass is undefined.

lukemelia avatar Sep 17 '19 02:09 lukemelia

I'm happy to review a PR to fix this but don't have time to work on one myself currently.

lukemelia avatar Sep 17 '19 02:09 lukemelia

Awesome @lukemelia. Just started the conversation on Discuss. Hope we can get to the bottom of it :)

jameshahn2 avatar Sep 17 '19 13:09 jameshahn2

@jameshahn2 Any progress on this?

evanb2 avatar Dec 05 '19 16:12 evanb2