# Modernizing inline script tags for templates & JS API

**URL:** <https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482>\
**Category:** Development\
**Tags:** dev-news\
**Created:** [May 19, 2025, 9:55am UTC](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482 "2025-05-19T09:55:17Z")\
**Posts on this page:** 1\
**Showing post:** 40

<div class="post-metadata">

**Author:** ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)\
**Post date:** [November 19, 2025, 6:24pm UTC](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482/40 "2025-11-19T18:24:37Z")

</div>

I have another deprecated theme component that uses

```plaintext
api.decorateWidget("post:after", helper => {
  const firstPost = helper.attrs.firstPost;

```

together with `return h("div.myimage", [`… to insert some HTML (an `href`) after the first post.

If I understand correctly, `api.decorateWidget` is also deprecated, but I can’t figure out how to do it with Glimmer. This method looks like what I need to determine if it’s the first post…  
[https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727#p-139082-conditional-rendering-6](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727#p-139082-conditional-rendering-6)  
…but I can’t figure out what is the recommended method now to insert the HTML I need.

---

_[View the full topic](https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482)._
