是不是只有我觉得 Hyperscript 很丑?

FYI I released a component few days ago which started as an example of what you can achieve with widgets and hbs:

Code is not perfect but you might learn a few things reading it.

@j.jaffeux thanks for that. I had a scan of the code and notice you extended things with ‘attach’ which is great.

Can you confirm it is not possible to use existing Helpers defined elsewhere in the app within a widget template?

您好,

您可以使用其中一些,而且添加更多其实并不难,对此提交 PR 可能会被欣然接受。

起点和可用助手的列表位于此 switch 语句中的 case 列表:

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-widget-hbs/lib/widget-hbs-compiler.js#L87

Very useful! Thanks.

Thanks for the heads up – I’ll have a good look through! :slight_smile: