Utilizzare un file hbs come modello per il widget

As this commit makes it possible to use hbs style code as a widget template, and that being a simpler and better way of doing things than generating HTML using the hyper script object.

I was thinking if it is possible(or would it be cool as a proposal) to be able to pass a .hbs file as a parameter to createWidget function’s template field instead of writing the template code there itself?

Penso che sia un’idea ragionevole consentirle di accettare un nome hbs grezzo lì. @eviltrout, cosa ne pensi?

In questo caso non possiamo usare hbs perché il compilatore hbs all’interno dei widget viene trasformato in virtual DOM, mentre il compilatore per .hbs utilizza il formato intermedio di Glimmer.

Potremmo creare un’altra estensione, ad esempio .widget.hbs o simile, che potrebbe funzionare.

Tuttavia, nella maggior parte dei casi, ha senso mantenere il codice del widget all’interno del widget stesso. Dovrei vedere un esempio convincente.

Correlati:

Questo supporta gli helper, ad esempio:

    <td style={{border-color c.color}}>

Perché non riesco a farlo funzionare se fornito come parte del modello.