From 7a46baa31c41f1a5d210affae469d691422c1b75 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 4 Oct 2024 16:04:08 +0100 Subject: [PATCH] DEV: Update `helper.renderGlimmer` example to gjs (#28962) --- .../discourse/app/widgets/decorator-helper.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/widgets/decorator-helper.js b/app/assets/javascripts/discourse/app/widgets/decorator-helper.js index a75db553ba5..e8059feead1 100644 --- a/app/assets/javascripts/discourse/app/widgets/decorator-helper.js +++ b/app/assets/javascripts/discourse/app/widgets/decorator-helper.js @@ -112,24 +112,22 @@ class DecoratorHelper { * Returns an element containing a rendered glimmer template. For full usage instructions, * see `widgets/render-glimmer.js`. * - * Example usage: + * Example usage in a `.gjs` file: * * ``` - * import { hbs } from "ember-cli-htmlbars"; - * * api.decorateCookedElement((cooked, helper) => { + * const iconName = "user-plus"; * // Generate a new element with glimmer rendered inside * const glimmerElement = helper.renderGlimmer( * "div.my-wrapper-class", - * hbs``, - * { param: "user-plus" } + * * ); * cooked.appendChild(glimmerElement); * * // Or append to an existing element * helper.renderGlimmer( * cooked.querySelector(".some-container"), - * hbs`I will be appended to some-container` + * * ); * }, { onlyStream: true }); * ```