新安装将在生产环境默认使用 Ember CLI 构建

As of today, all new self hosted installs of Discourse will default to using our Ember CLI builds in production.

We’ve been running these builds ourselves in production for quite some time now and they should be stable and work with all major plugins. If you encounter any issues and need to turn it off, edit your app.yml and remove EMBER_CLI_PROD_ASSETS: 1

Otherwise, please report any bugs to us and we’ll be quick to fix them.

In the near future all installs of Discourse will be using the Ember CLI builds.

18 个赞

Current self hosted sites, does it require an rebuild or admin upgrade to switch over ?

3 个赞

My interpretation is that for existing installs, you can switch to using Ember CLI by doing one of two things:

  1. Edit app.yml to add the EMBER_CLI_PROD_ASSETS: 1 line, then rebuild, or
  2. Wait until “the near future” when it becomes the standard, then rebuild
5 个赞

Yes @Simon_Manning is correct - you can enable it yourself manually if you wish, or you can wait for it to become the default. We are rolling it out slowly to try and catch all the bugs in advance.

7 个赞

ok, i have it installed. anything i need to keep an eye on ?

1 个赞
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
1 个赞

Just let us know if anything is broken, please.

4 个赞

Could you also explain what it entails and why it matters — to those not familiar with the Ember ecosystem.

9 个赞

Hi, any ETA? Thank you.

1 个赞

you can already implement it.

All you need to do it add a line to your app.yml and rebuild.

2 个赞

We plan to enable it for older sites in around a month from now.

8 个赞

I’m super excited about this change and it’s a great thing for the future of Discourse.

I would simply recommend this: if you are running any third party theme components or plugins, please spin up a separate test instance with the same set and check it all out there before moving to ember cli on your main site.

I have just released some significant changes to one of my Theme Components without which it would have broken the host site.

14 个赞

There’s more information here:

The short version is: this is the officially supported way to develop Ember applications and should make it easier for people to contribute and for us to ugprade Ember in the future.

9 个赞

Yes, I set up EMBER_CLI_PROD_ASSETS: 1 but Dracula Theme is not working well.
so I remove this feature :frowning:

3 个赞

You should post on Dracula a Dark Theme for Discourse so that they can fix it.

5 个赞

这个改变可能会破坏的唯一主题组件是那些包含 Wyeth JavaScript 的组件,这是真的吗?

有没有简单的方法可以查询到包含 JavaScript 的主题组件?无论是通过数据浏览器还是 Rails 查询?我想知道哪些站点可能会受到影响,并主动提出让他们使用我的新产品(免费,这样我终于可以找到一些测试者)来安装一个暂存站点,以便在他们升级生产站点之前进行测试。

1 个赞

这是真的——这个 ember CLI 的更改不会影响主题/组件的 HTML 或 CSS 部分。

一般来说,你可以通过在旧的非 ember-cli 环境下,在浏览器的 JS 控制台中查找黄色的弃用通知来识别出有问题的组件。(迁移到 Ember CLI 是我们引入这些弃用的原因)

Meta 已经运行 Ember CLI 数周,我们一直在努力确保我们所有的官方主题/插件在新环境中都能正常工作。

6 个赞

好的。所以如果我拉取 /admin/customize/themes.json(或者实际路径是什么),它里面会有警告。我们认为这可能会有误报(即没有警告,但在升级时会失败)吗?

哦,如果它确实失败了,你只需要切换回环境变量。

对于插件,如果我在 JavaScript 控制台中看到弃用警告,那么我最终是否必须弄清楚它们的含义?似乎它们来自我正在使用的组件,而不是我的代码,但 Ember 和 JavaScript 对我来说仍然相当神秘。(尽管我写了很多代码,至少大部分是我写的)。

2 个赞

不,弃用警告会在您的浏览器控制台中运行时出现。它们不会出现在主题 REST API 中。

现在可以这样做。但我们很快就会将其设为非可选默认值,所以最好的解决方案是解决根本原因。

是的,恐怕是这样。如果您认为它们来自核心组件,或者您难以找到原因,请在 Dev 主题中提供详细信息。

5 个赞

哈。如果你运气好的话。如果运气不好,您将收到完整的错误消息,并且javascript执行将完全停止。这可能导致页面变为空白或损坏。

到目前为止,我发现各种问题,但大多数是Discourse对象的某些属性丢失,因此您必须找到一种不同的方法来访问站点和用户属性。(提示:这些在组件内是可访问的。您可以看到我最近在TLP TC上所做的工作)

2 个赞