Semantic-UI-Ember icon indicating copy to clipboard operation
Semantic-UI-Ember copied to clipboard

Ember 3.9 DEPRECATION: Using this.$() in a component has been deprecated, consider using this.element [deprecation id: ember-views.curly-components.jquery-element]

Open arun-prasad-r opened this issue 6 years ago • 9 comments

I've recently upgraded to ember 3.9 and I get a ton of this deprecation warning in the console.

DEPRECATION: Using this.$() in a component has been deprecated, consider using this.element [deprecation id: ember-views.curly-components.jquery-element]

In my case the error came from using semantic ui dropdown component. The error originates from the semantic base mixin. (mixins/base.js)

// /assets/addon-tree-output/semantic-ui-ember/mixins/base.js
    getSemanticScope() {
      if (Ember.isPresent(this.get('onElement'))) {
        return this.$(this.get('onElement'));
      }
      return this.$(); //<-- Error
    },

arun-prasad-r avatar Apr 12 '19 09:04 arun-prasad-r

I'd appreciate a fix as well.

Unkrass avatar Apr 25 '19 09:04 Unkrass

Guys i tried fix this issue here https://github.com/Semantic-Org/Semantic-UI-Ember/pull/250 . Hope it helps!

nerdiken avatar May 14 '19 13:05 nerdiken

I would appreciate the fix as well

Polve avatar Jun 05 '19 16:06 Polve

With the version 3.0.4 (tagged yesterday), this issue has been fixed! A simple yarn upgrade semantic-ui-ember and no more warnings. 😊

MonsieurDart avatar Dec 11 '19 16:12 MonsieurDart

@MonsieurDart is that true? I'm still seeing the warning after upgrading to 3.0.4.

allthesignals avatar Jan 27 '20 21:01 allthesignals

Yep, quite sure. Maybe your warnings also come from an other addon?

MonsieurDart avatar Jan 28 '20 05:01 MonsieurDart

I'm pretty sure just enabling jquery integration does not stop deprecation messages. You have to move away from this.$ for that

iamareebjamal avatar Jan 29 '20 07:01 iamareebjamal

https://deprecations.emberjs.com/v3.x/#toc_jquery-apis

iamareebjamal avatar Jan 29 '20 07:01 iamareebjamal

Right, sorry, some minor detail context: I am seeing this in Ember Octane (3.15) :) which might explain why we're seeing different behavior.

So I think we should find a way to move away from this.$ or some other workaround for addons that require jQuery...

Also, maybe something is up with the deprecation warning? I wonder what would happen if this.$ were defined explicitly in the addon?

allthesignals avatar Jan 29 '20 16:01 allthesignals