Is it just me, or is Hyperscript hideous?

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.

8 Likes

@joffreyjaffeux 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?

5 Likes

Hi,

you can use some of them, and it’s actually not that hard to add more, PR on this would probably be gladly accepted.

Starting point and list of available helpers are the list of cases in this switch:

https://github.com/discourse/discourse/blob/master/lib/javascripts/widget-hbs-compiler.js.es6#L87

5 Likes

Very useful! Thanks.

4 Likes

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

3 Likes