mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 11:58:27 +00:00
This allows an arbitrary Glimmer template to be rendered inside a Widget. That template can include any kind content, including Classic Ember components and Glimmer components. This leans on Ember's official `{{#in-element}}` helper which means that all component lifecycle hooks are called correctly. This is a modern replacement for our existing `ComponentConnector` implementation. We'll deprecate `ComponentConnector` in the near future. Example usage: ```javascript // (inside an existing widget) html(){ return [ new RenderGlimmer( this, "div.my-wrapper-class", hbs`<MyComponent @arg1={{@data.arg1}} />`, { arg1: "some argument value" } ), ] } ``` See `widgets/render-glimmer.js` for documentation, and `render-glimmer-test` for more example uses.