Removal of ember-addons/ember-computed-decorators

@markvanlan The move of the decorators from ember-addons/ember-computed-decorators to discourse-common/utils/decorators is about to break a number of plugins and themes as soon as folks hit the big blue update button.

Would it be possible to leave the existing decorators in place (in addition to the new ones) to give us time to make the transition?

3 Likes

This should not be a breaking change. Here in the discourse-loader file, we have added an alias, so that anytime you try and import ember-addons/ember-computed-decorators, it will automatically load discourse-common/utils/decorator instead.

3 Likes

Yeah, I saw that. I’m not sure why, but that doesn’t seem to be working in all cases. I’m gettting a lot of requirejs errors that seem to resolve once I move to the new import.

1 Like

Are you able to see if it is happening when using require instead of import?

That was a bug that I thought I had fixed.

4 Likes

Hi,

Here is the error message I hit on my Discourse site:

Does this still need to be updated in the code base?

I can’t see exactly where that error is coming from (what plugin is using ember-addons/ember-compted-decorators), but it does eventually need to be fixed.

That is a warning, rather than an error because ember-addons/ember-compted-decorators is still functional for now.

5 Likes

Thanks @markvanlan,

What method do you use or recommend to identify a plugin that’s using deprecated assets?

I would see what plugins you have installed on your instance, then go to each repository in Github and search for ember-addons/ember-compted-decorators.

I believe some of our official Discourse plugins still need this updated so it could be one of our repos.

4 Likes

Can you expand that and see the full backtrace?

3 Likes

I don’t know how to see the backtrace behind a browser console warning?

I do know how to grep plugins though :smile:

$ grep -r ember-addons/ember-computed-decorators plugins/|grep import|awk -F / '{print $2}'|uniq|sort
discourse-canned-replies
discourse-local-dates
discourse-presence
discourse-push-notifications
discourse-saved-searches
procourse-memberships
6 Likes

Hi, I can’t currently reproduce it. But, the phenomenal @RGJ just updated the plugins on our site and I think this resolved the error? He pointed me to these updates:

DEV: Find/replace deprecated decorators Ā· discourse/discourse-data-explorer@277346b Ā· GitHub

2 Likes

Nice Grep Richard! :slight_smile:

I don’t think this is a lot to panic about.

It’s the responsibility of plugin makers to minimise these warnings ASAP too.

I’ve resolved quite a few recently and there will be more. It’s a never ending story :wink:

They are just warnings and nothing to really worry about unless they are ignored for too long.

2 Likes

Thanks. I love that Discourse continues to improve and maintain its code!

4 Likes