移除 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?

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.

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.

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.

你好,

我在我的 Discourse 网站上遇到了以下错误信息:

Screen Shot 2020-02-19 at 2.50.56 PM

这是否仍需要在代码库中进行更新?

我无法确切看到该错误来自哪里(是哪个插件正在使用 ember-addons/ember-computed-decorators),但它最终需要被修复。

这是一个警告而非错误,因为 ember-addons/ember-computed-decorators 目前仍可正常运行。

感谢 @markvanlan

您使用或推荐什么方法来识别正在使用已弃用资源的插件?

你可以查看你的实例上安装了哪些插件,然后逐个访问 GitHub 上的仓库,搜索 ember-addons/ember-computed-decorators

我相信我们的一些官方 Discourse 插件仍然需要更新这个依赖,所以它可能就在我们的某个仓库中。

您能展开它并查看完整的堆栈跟踪吗?

我不知道如何查看浏览器控制台警告背后的堆栈跟踪?

不过我知道如何 grep 插件::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

你好,我目前无法复现该问题。不过,杰出的 @RGJ 刚刚更新了我们的网站插件,我想这已经解决了错误?他向我指出了这些更新:

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

干得漂亮,Richard!:slight_smile:

我认为这没什么好恐慌的。

插件开发者也有责任尽快尽量减少这些警告。

我最近已经解决了不少问题,未来还会有更多。这就像一场没有终点的故事;)

它们只是警告,除非被长期忽视,否则真的没什么好担心的。

谢谢。我很高兴 Discourse 能够持续改进并维护其代码!